【问题标题】:git merge lock on MacMac 上的 git 合并锁
【发布时间】:2016-02-07 22:39:51
【问题描述】:

我正在 git 沉浸式教程中进行合并实验室。当我进入

$ git merge 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.

我不知道如何完成合并。我已经尝试过C - X 和各种命令,例如:wq,它们似乎适用于vi 文本编辑器,但我相信我有emacs 编辑器。我知道让我离开编辑器并返回 shell(我正在使用 bash)的唯一命令是 C - Z,但这会撤消合并。

如何保存/完成合并?

已解决:根据以下建议,切换到编辑器“nano”,我能够完成合并。感谢您的帮助!

【问题讨论】:

  • 也许您应该首先配置一个您熟悉和喜欢的编辑器。 :-) 使用git config --global core.editor <name of editor> 更改编辑器设置。
  • 在“vi”、“nano”或其他之间有什么建议吗?对 git 和 shell 来说非常新。..
  • 我自己使用 vi(现在是 vim),但这是因为它是 1981 年唯一合适的编辑器。

标签: git emacs merge


【解决方案1】:

听起来您正在使用不熟悉的编辑器。考虑用

改变它

git config --global core.editor nano

git config --global core.editor vim

此处的文档:https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#Basic-Client-Configuration

【讨论】:

    猜你喜欢
    • 2013-08-13
    • 2023-03-25
    • 2011-03-03
    • 1970-01-01
    • 2016-12-09
    • 2015-02-28
    • 1970-01-01
    • 2010-12-26
    • 2023-03-06
    相关资源
    最近更新 更多