You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I've had a lot of cases when I need to fixup commits into previous ones to keep git history clean. I've also started to give them all 'f' in message. This script automates this repetitive workflow of mine. Might be useful if you are using GUI for Git.
Just copy `post-commit' into `.git/hooks` of your repository.
Usage:
git commit -m "f"
How it works:
Stash everything that was not commited. The stash won't be created if there are no changes that you did not commit.
Reset created commit.
Amend changes into previous commit.
Pop stash if the first step had created one.
About
Recently I've had a lot of cases when I need to fixup commits into previous ones to keep git history clean. I've also started to give them all 'f' in message. This script automates this repetitive workflow of mine. Might be useful if you are using GUI for Git.