Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change a commit message after a 'git-pull' auto-merge?

Occasionally, my collaborators will "panic" when there is an automatic merge generated as the result a git-pull, and just accept the default commit message. Before this commit gets pushed, I want to be sure the message gets fixed, but --amend seems not to work. What is the best way to fix the message that's generated in this scenario. The best instructions I can come up with for them are

git reset --soft HEAD~
git merge -m <message> <the tracked remote branch>

but that seems a bit scary (reset) and error prone (the remote tracked branch has to be entered explicitly).

Is there a simple way to change the commit message that was just generated by merging with a remote tracking repo? Why doesn't --amend work?

like image 812
orome Avatar asked Nov 25 '22 06:11

orome


1 Answers

git commit --amend should work in this scenario. What exactly does not work?

like image 50
Chronial Avatar answered Dec 09 '22 15:12

Chronial