如何在编辑器

时间:2018-05-07 09:11:45

标签: git github

虽然我试图在编辑器中输入git commit消息,看起来像Vi,但是没有像wq,escape等命令正常工作。无论何时,我尝试合并我的主人,这个窗口弹出窗口:

Merge branch 'master' into awesomebar

# 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.



--**-Mg: MERGE_MSG                        (fundamental)----All------------------------------------------------------------------------------------------------------------------------------

并且光标停留在句子“Merge branch'master'into awesomebar”的开头。我也不能移动光标,也不能逃脱。键入escape会提供以下命令:

Merge branch 'master' into awesomebar

# 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.



--**-Mg: MERGE_MSG                        (fundamental)----All------------------------------------------------------------------------------------------------------------------------------
ESC-

一旦键入内容,我甚至无法删除它。我该如何处理?

2 个答案:

答案 0 :(得分:1)

看起来像Joe

据我所知,要保存并退出,您必须输入^kx(其中^等于CTRL)。

如果您想更改默认的Git编辑器,只需更新您EDITOR中的~/.bashrc变量:

export EDITOR="vim"

答案 1 :(得分:0)

(fundamental)行暗示这是某种Emacs:基本模式是Emacs的Major Modes之一。

这是Emacs基本用法的文档: