Git merge doesn't use default merge message, opens editor with default message
GitGit MergeGit Problem Overview
How can I force git merge
to use the default merge message instead of loading my editor with said message?
I have no editor listed in git config -l
, so I'm not sure why it opens an editor.
Git Solutions
Solution 1 - Git
Found the answer after some digging
EDIT: As per Mark's suggestion, this is the best way to do so:
git config --global core.mergeoptions --no-edit
Solution 2 - Git
Use
export GIT_MERGE_AUTOEDIT=no
or
git merge --no-edit
Solution 3 - Git
This is a new feature of Git, introduced in Git 1.7.10, to use the old one (don't provide a message on merge) put these two lines in your .bash_profile
or .bashrc
GIT_MERGE_AUTOEDIT=no
export GIT_MERGE_AUTOEDIT
Solution 4 - Git
try this
git merge --no-ff --no-edit -m "my custom merge message" somebranch