Hacker News new | ask | show | jobs
by johnkeeping 4021 days ago
Or simply:

    git add ...
    git commit --fixup $SHA
    git rebase -i --autosquash --autostash $SHA~
1 comments

It gets more complicated if you have some other modified content that you wanna leave untouched. You then need to stash it or commit it separately.

The point of the alias is to make it all more user-friendly and less error-prone.

That's what the `--autostash` is for. It also has the advantage that the stash will be restored at the end of the rebase even if it hits problems and needs to be continued or aborted.