git pull - 无法提交合并消息
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14095867/
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
git pull - can't submit merge message
提问by Daan
Possible Duplicate:
github locks up mac terminal when using pull command
I am using git via the terminal on the mac.
I have encountered an annoying problem recently when I try to perform git pull
.
After performing git pull
I receive the following error message:
我正在通过 Mac 上的终端使用 git。我最近在尝试执行git pull
. 执行后,git pull
我收到以下错误消息:
Merge ssh://domain.com/repository.git
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts:
# the commit.
The issue is that I can't enter anything. My terminal seems stuck and there isn't anything I seem to be able to do about it. I am reasonably new to git so it may be a simple mistake I am making.
问题是我无法输入任何内容。我的终端似乎卡住了,我似乎无能为力。我对 git 相当陌生,所以这可能是我犯的一个简单的错误。
I read herethat for some people the text editor opens at this point. This certainly isn't the case at my end. It also states there that I can use the --no-edit flag to merge without a message, but even this does not seem to work at my end.
我在这里读到,对于某些人来说,此时文本编辑器会打开。这当然不是我最后的情况。它还指出我可以使用 --no-edit 标志在没有消息的情况下进行合并,但即使这在我看来也不起作用。
I am a bit clueless at the moment, stuck and unable to push any changes to my server.
我现在有点无能为力,卡住了,无法将任何更改推送到我的服务器。
回答by Luigi R. Viggiano
This is vim, it's a common unix editor
这是vim,它是一个普通的unix编辑器
press:
按:
:wq
that's it. (w=write q=quit)
就是这样。(w=写 q=退出)
回答by KingCrunch
When you see this, an editor already opened, because you see this ;) I guess it opens vi
, or a derivate of this. Google for it to find out how to use it, but it seems you prefer to change the editor instead
当你看到这个时,一个编辑器已经打开,因为你看到了这个 ;) 我猜它打开了vi
,或者它的一个派生。Google for it 以了解如何使用它,但您似乎更喜欢更改编辑器
git config --global core.editor "emacs"
I prefer nano
:)
我更喜欢nano
:)