The way git commit --fixup --autosquash should work
I have an extremely useful alias that I use extensively in my git workflow:
alias gfixup="git commit --fixup HEAD && EDITOR=cat git rebase -i --autosquash HEAD~2 | sed '/^#/ d'"
What it does
Commits changes in the git index and auto-squashes the commit into the previous commit without opening $EDITOR!
The workflow
- git add .