Here is the scenario:
- I am rebasing a branch in git, I had conflicts and just resolved them (did
git addand everything). - Normally, I would just run
git rebase --continueto proceed with the rebase - I want to edit the commit message of this commit, to explain the changes I made when resolving the conflict
I don't usually do this, but this particular conflict required some serious recoding, which I feel needs to be documented.
How do I do this? I'm hoping there is a git rebase --continue --let-me-edit-the-message-first command of some sort, but I have not been able to find it in the documentation
I know that:
- I could run git commit, manually copying the existing commit message and then modifying it. I don't want to do this.
git rebasemust have the commit message stored somewhere, because when it commits it will put the original message in. I just want to insert my edits in between. - I could just run git
rebase --continue, and then use gitrebase -ito go back and edit the commit messages in question later on. This requires me to remember what I changed in which commits throughout the entire (potentially long) rebase process. Yuck.
I'm a little surprised that I couldn't find an answer to this already... I'm hooping there's a way to do this. If there is an answer for this I had difficulty finding it. I found things like confusion that amounts to the need for git add or git rm after resolving changes (like this), general git rebase wisdom (like this and this), and lots of questions that seem very specific to a particular case (like this).
Since I'm so surprised I couldn't find this answer, I have a secondary question: is there a fundamentally better way to document changes made during rebase?
rebase, conflict, add, continue -> editor). Have you ever seen a commit message editor when rebasing? Which Git version are you talking about?git rebase --continue. I am working with git version 1.9.1, but I would be surprised (though not too surprised) if there were huge differences across recent versions.GIT_EDITORenvironment orcore.editorconfig is messed up? Do you see any error after issuinggit rebase --continue? Just to be on the safe side: which rebase mode are you doing? Rebase onto or against a branch, interactive rebase to squash/delete/reword/edit commits? Please complete the scenario in your post together with the version by editing (this will make me upvoting your post too if it's complete ;).git commitfor instance). GIT_EDITOR is not set for me, andgit config core.editorproduces no output (and an exit code of 1)