Amend a specific commit
Currently it's only possible to amend the latest commit. It would be nice to have the option to amend the second-latest commit or any other commit.
Currently to do this I have to do the following steps:
- Commit my changes (with bogus commit message)
- Start interactive rebase from the parent of the commit I want to amend
- Move the new commit down and squash it into the commit I want to amend (this automatically adds the commit message of the squashed commit to the description of the amended commit, which I don't want)
- Finish rebase
- Edit description of amended commit to remove the bogus commit message (which causes another rebase)
It would be nice if this process could be automated. For example as a right-click option on a commit: "Amend with staged changes" (perhaps followed by a confirmation dialog saying how many commits will have to be rebased).
Comments: 2
Oldest
•
Newest
•
Most likes
•
Fewest likes
-
29 May, '23
UnShameThis is such a common annoyance for me, I'm surprised this suggestion has been buried so deep for so long.
-
08 Oct, '25
paulvyes it would be very useful for when you forget something in a previous/old commit and want to add it quickly other there. For the UX I was more thinking something like: drag the file I changed but not yet commited (in the unstagged/staged window) and drop it onto the old commit i want to amend it to