How do I edit or reword a merge commit\'s message?
git commit --amend works if it\'s the last commit made (HEAD), but what if it comes befo
Another nice answer using only primitive commands -- by knittl https://stackoverflow.com/a/7599522/94687:
git checkout
git commit --amend # edit message
git rebase HEAD previous_branch
or a better (more correct) final rebase command:
git rebase previous_branch --onto HEAD
BTW, using the primitive commands might have the nice "feature" of not consuming too much CPU and making you wait unknown time until Git finishes thinking about the list of commits needing to be rebased in the case of git rebase -p -i HEAD^^^^ (such a command which would result in a list of only 4 last commits with the merge as last one in my case in my case took around 50 secs!).