如何在此编辑器中输入Git提交消息? [英] How to enter a Git commit message in this editor?
问题描述
我正在尝试在看起来像Vi的编辑器中输入Git提交消息,但是没有任何命令,例如:wq
, Esc 等。 在工作中。每当我尝试合并master分支时,都会弹出此窗口:
I am trying to enter the Git commit message in the editor which looks like Vi, but none of commands like :wq
, Esc etc. are working. Whenever I try to merge the master branch, this window pops up:
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-------------------
光标停留在句子的开头,将分支 master合并到awesomebar中
。我既不能移动光标,也不能退出。键入 Esc 会给出以下命令:
And the cursor stays right at the beginning of the sentence Merge branch 'master' into awesomebar
. Neither can I move the cursor, neither can I exit. Typing Esc gives the following commands:
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-
一旦输入内容,我什至无法删除。我该如何处理?
And once I type something, I can't even delete it. How do I deal with this?
推荐答案
它看起来像是 Joe
It looks like to be Joe
据我所知保存并退出,您必须输入 ^ kx
(其中 ^
等于 CTRL
)。
From what I know to save and exit you must type ^kx
(where ^
is equal to CTRL
).
如果要更改默认的Git编辑器,只需更新 EDITOR
变量,您的〜/ .bashrc
例如:
If you want to change default Git's editor, just update the EDITOR
variable, in your ~/.bashrc
by example:
export EDITOR="vim"
这篇关于如何在此编辑器中输入Git提交消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!