I made a simple script below I find useful that commits current changes then automatically
rebases and squashes it with the previous commit, preserving the previous
commit message. I find it useful for a way to quickly save current changes before switching
branches, or for easily backing up work before its worth making a new separate commit:
git add --all
git commit --fixup=HEAD~1
GIT_SEQUENCE_EDITOR="sed -i -re 's/^pick (.*)fixup! (.*)/fixup \1\2/'" git rebase -i --autosquash --autostash --keep-empty HEAD~2