Git merge doesn't use default merge message, opens editor with default message

GitGit Merge

Git 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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkjbView Question on Stackoverflow
Solution 1 - GitkjbView Answer on Stackoverflow
Solution 2 - GitouahView Answer on Stackoverflow
Solution 3 - GitOrlandoView Answer on Stackoverflow
Solution 4 - Gitdawn360View Answer on Stackoverflow