使用pull命令时,github会锁定mac终端

zer*_*ero 93 git terminal github

我正在学习mac(命令行)上的github,每当我git pull origin master得到这个

# 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.
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
".git/MERGE_MSG" 7L, 293C
Run Code Online (Sandbox Code Playgroud)

终端似乎锁定并且不允许我立即输入任何内容,然后当它最终允许我输入文本时,它似乎无法识别git命令.

这是git中的错误还是我错过了什么?

cey*_*yko 214

你在文本编辑器中,vim!它是一个模态文本编辑器,因此您需要:

  1. i进入插入模式.
  2. 现在,您可以键入消息,就像使用普通(非模态)文本编辑器一样.
  3. esc返回命令模式.
  4. 然后键入:w后跟enter保存.
  5. 最后:qenter退出.

  • git假设每个人都知道vim是很棒的。 (2认同)
  • @ user124384 Git尝试使用你的`$ EDITOR`环境变量,但如果它找不到,则回退到'vi`.您可以通过git config的`core.editor`配置回退.请参阅https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#coreeditor-mjjck (2认同)

abb*_*bas 18

简单一点.

类型:wqenter