From 1333250deffa4e15c520bd9ad429dbe268c82bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin-Charles=20Guih=C3=A9neuf?= Date: Mon, 27 Apr 2026 13:53:29 +0200 Subject: [PATCH] navi: Add git patch cheat sheets --- navi/git.cheat | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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}'