diff --git a/navi/git.cheat b/navi/git.cheat index 7c66589..164e219 100644 --- a/navi/git.cheat +++ b/navi/git.cheat @@ -67,5 +67,30 @@ git push origin git tag -d git push -d origin +# Create a patch from current full diff +git diff > .patch + +# Create a patch from current file diff +git diff > .patch + +# Create a patch from commit(s) +git format-patch .. + +# Show a diff patch +git apply --stat + +# Check a diff patch +git apply --check + +# Apply a diff patch +git apply + +# Apply a commit patch +git am + # Variables $ tag_name: git tag -l | awk '{print $1}' +$ diff_file: git diff --name-only | awk '{print $1}' +$ first_commit: git log -n 20 --oneline | fzf --preview 'git show --color=always {1}' | awk '{print $1}' +$ last_commit: git log -n 20 --oneline | fzf --preview 'git show --color=always {1}' | awk '{print $1}' +$ patch_name: ls *.patch | awk '{print $1}'