From 6296ba2187a1e0ff66c3db361b30eb91f6aa6cb9 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 8 Jul 2020 13:53:36 +0200 Subject: [PATCH] [ADD][GIT] Alias to fixup last commit on file --- git/.config/git/config | 1 + 1 file changed, 1 insertion(+) diff --git a/git/.config/git/config b/git/.config/git/config index 76f9106..6e8e5c7 100644 --- a/git/.config/git/config +++ b/git/.config/git/config @@ -71,6 +71,7 @@ unassume = update-index --no-assume-unchanged assumed = "!git ls-files -v | grep ^h | cut -c 3-" push-new = "!git push -u \"${1:-origin}\" \"$(git branch | grep '^* ' | cut -f2- -d' ')\"" + fixup = "!f() { git add -- \"$1\"; git commit --fixup \"$(git log -n 1 --pretty=format:%H -- \"$1\")\"; }; f" [filter "lfs"] clean = git-lfs clean -- %f