Git 合并不使用默认合并消息,使用默认消息打开编辑器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12752288/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 07:35:25  来源:igfitidea点击:

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

gitgit-merge

提问by kjb

How can I force git mergeto use the default merge message instead of loading my editor with said message?

如何强制git merge使用默认合并消息而不是使用所述消息加载我的编辑器?

I have no editor listed in git config -l, so I'm not sure why it opens an editor.

我没有在 中列出编辑器git config -l,所以我不确定它为什么会打开一个编辑器。

回答by kjb

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

回答by ouah

Use

export GIT_MERGE_AUTOEDIT=no

or

或者

git merge --no-edit

回答by Orlando

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_profileor .bashrc

这是 Git 的一项新功能,在 Git 1.7.10 中引入,使用旧功能(不要在合并时提供消息)将这两行放在您的.bash_profile.bashrc

GIT_MERGE_AUTOEDIT=no
export GIT_MERGE_AUTOEDIT