kjb
kjb

Reputation: 3175

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

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.

Upvotes: 84

Views: 21039

Answers (4)

dawn360
dawn360

Reputation: 11

try this

git merge --no-ff --no-edit -m "my custom merge message" somebranch

Upvotes: 0

Orlando
Orlando

Reputation: 9712

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

Upvotes: 12

kjb
kjb

Reputation: 3175

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

Upvotes: 100

ouah
ouah

Reputation: 145899

Use

export GIT_MERGE_AUTOEDIT=no

or

git merge --no-edit

Upvotes: 75

Related Questions