Just right-click on the commit you want to edit and select Interactively Rebase from Here… Select reword on the commit and click Start Rebasing. Edit the commit message and click Resume Rebasing.
On the command line, navigate to the repository that contains the commit you want to amend. Type git commit --amend and press Enter. In your text editor, edit the commit message, and save the commit.
Use the awesome interactive rebase:Find the commit you want, change pick to e ( edit ), and save and close the file. Git will rewind to that commit, allowing you to either: use git commit --amend to make changes, or.
I'm currently in the midst of a git rebase --interactive
session, where I'm editing a commit. I'm proceeding as suggested by How can I split up a Git commit buried in history? i.e. I ran git reset HEAD^
and did my modifications.
Now I want rebase to continue, which requires me to commit my changes. I'd like to modify my old commit message, but the problem is, if I run git commit --amend
, I'm given the commit message of the commit before the one I'm actually modifiying -- and I certainly don't want to merge my changes into that commit.
So how do I retrieve my old commit message for the commit I'm working on now?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With