How to use the default git commit message after resolving merge conflicts?
Per the docs, I just tried this simple command and it worked for me:
git commit --no-edit
Afterward, run git log
to confirm that the default message has been used.
Just set the editor to a command that does nothing:
GIT_EDITOR=true git commit
By default when a merge fails the commit message that was to be used is saved in a file in the git folder, usually .git/MERGE_MSG
. After the conflicts are resolved running git commit
will feed this saved message to the default editor.
If the message is not being picked up on its own it could be feed to the git command using the --file
option, which reads the commit message from a file:
git commit --file .git/MERGE_MSG