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.
Join Stack Overflow to learn, share knowledge, and build your career.
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
~/.gitconfig
directly, it might be safer to suggest using git config
to do this, e.g. git config --global core.mergeoptions --no-edit
, so that there's no chance of creating a malformed ~/.gitconfig
.
– Mark Longair
Oct 5 '12 at 22:04
git merge
's, but I'm still having an editor open up for git pull
's. Is there any way to disable the commit message for this as well?
– LandonSchropp
Nov 21 '13 at 7:29
core.mergeoptions
, though it certainly applies to branch.*.mergeoptions
. Does anyone know the supported versions for this?
– cmbuckley
Nov 27 '13 at 16:49
core.mergeoptions
. There is, however, a GIT_MERGE_AUTOEDIT=no
that was added to git 1.7.10 when git merge
itself was changed to bring up the editor. There are also options available as branch.*.mergeoptions
, as @cmbuckley noted.
– torek
Apr 22 '16 at 2:57
Use
export GIT_MERGE_AUTOEDIT=no
or
git merge --no-edit
git merge
– kjb
May 13 '13 at 1:46
git merge
. Perhaps git merge -m "message"
works but I haven't tried it yet.
– Ernesto
Feb 19 '15 at 20:24
export GIT_MERGE_AUTOEDIT=no
worked (for merges) when the accepted answer (git config --global core.mergeoptions --no-edit
) did not.
– Andrew Bennet
Apr 19 '16 at 16:07
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
--no-edit
? – Joachim Isaksson Oct 5 '12 at 18:52