Git 拉动打开 VIM 即使使用 --no-edit

Git Pull opens VIM even with --no-edit

"Vim opens asking for commit message after implicit non-conflicting merge" 似乎是一个相对常见的问题,似乎是 relatively simple answergit config --global core.mergeoptions --no-edit

不幸的是,这似乎对我或我 class 中的其他 15 个人中的至少 8 个都不起作用,而且我们的教练也有点困惑(尽管公平地说他没有除了快速 google 搜索一两次之外,还有时间研究它)。 不是什么大问题,因为您可以使用 :q 轻松逃脱,但这是我们想知道的答案,我的google 搜索 return 堆栈溢出问题 --no-edit 作为解决方案(通过核心或每次完成拉动)。

我的 .gitconfig(减去个人信息):

[mergetool "kdiff3"]
        path = "/c/Program Files/KDiff3/kdiff3.exe"
[merge]
        tool = kdiff3
[core]
        mergeoptions = --no-edit
[mergetool]
        keepBackup = false

还有:

.

有谁知道为什么修复不起作用(即:"Ya dun goofed in spelling 'options'"),或者是否有 better/more 可靠的方法来解决这个问题?

通过将 export GIT_MERGE_AUTOEDIT=no 添加到 .bash_profile 文件来解决此问题。

您需要在.bash_profile中添加export GIT_MERGE_AUTOEDIT=no并打开一个新的bash。

您可以使用下一个 bash 命令:

echo 'export GIT_MERGE_AUTOEDIT=no' >> $HOME/.bash_profile && . $HOME/.bash_profile

希望对您有所帮助 :D