├── git-retroamend.sh └── readme.md /git-retroamend.sh: -------------------------------------------------------------------------------- 1 | hash=$1 2 | git add . 3 | git commit --fixup $hash 4 | # 'GIT_EDITOR=true' makes the rebase non-interactive 5 | GIT_EDITOR=true git rebase -i --autosquash $hash^ 6 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | If you are in love with a clean git history, you probably sometimes wish to apply your current changes to an old commit. 2 | 3 | Every time I do that, I dabble with interactive git rebase, hoping I remember gits internals well enough to not mess up my repo. 4 | 5 | To make things easier, I wrote a script for it. 6 | 7 | Type this and the current changes are made part of the commit with the given hash: 8 | 9 | **git-retroamend.sh ** 10 | 11 | --------------------------------------------------------------------------------