【发布时间】:2019-02-08 15:24:56
【问题描述】:
几天前,我尝试配置 Sublime Text 3,这样当我在 git 中提交时它会打开,但总是会出现错误,当我尝试放回 vim 时,我得到了这个:
MacBook-Air-de-Andres:bin andr3yvlz$ git config --global core.editor vim
warning: core.editor has multiple values
error: cannot overwrite multiple values with a single value
Use a regexp, --add or --replace-all to change core.editor.
我也尝试这样做:
MacBook-Air-de-Andres:bin andr3yvlz$ git config --replace-all core.editor vim
fatal: not in a git directory
MacBook-Air-de-Andres:bin andr3yvlz$
提交错误是:
MacBook-Air-de-Andres:Andr3yvlz andr3yvlz$ git add .
MacBook-Air-de-Andres:Andr3yvlz andr3yvlz$ git commit
hint: Waiting for your editor to close the file... subl -n -w: subl: command not found
error: There was a problem with the editor 'subl -n -w'.
Please supply the message using either -m or -F option.
MacBook-Air-de-Andres:Andr3yvlz andr3yvlz$
如果有人知道如何使用 git 配置 sublime,那将非常有帮助,在此先感谢
【问题讨论】:
-
您可以使用
git config --global --replace-all更改它(同时提供两个选项)。 -
我建议打开你的用户配置文件的
.gitconfig文件,看看你在哪里有core.editor的副本,并可能在那里进行调整(尽管建议使用 git 命令进行更改)。你应该可以在 Mac 上找到它:~/.gitconfig