4 ms·
It's not exactly hard to do by hand: git add ... git commit --fixup $SHA git stash git rebase -i --autosquash $SHA~ git stash pop
by dr4g0n 11y ago
It's not exactly hard to do by hand:
git add ...
git commit --fixup $SHA
git stash
git rebase -i --autosquash $SHA~
git stash pop
- rlpb 11y agoOr, alternatively, just git rebase -i, mark the comment for amending with "e", then when it stops for amending amend what you need and commit with "git commit --amend", then "git rebase --continue" to finish. Wrap with stash if you don't have a clean working directory to start with.
- johnkeeping 11y agoOr simply: git add ... git commit --fixup $SHA git rebase -i --autosquash --autostash $SHA~
- koreno 11y agoIt 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.
- johnkeeping 11y agoThat'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.
- andrewaylett 11y agoYou can even use --autostash to avoid the manual stash, and if you're doing this a lot then the config options rebase.autosquash and rebase.autostash are your friends.
- koreno 11y agoNice! wasn't familiar was autostash.