麻烦设置git'core.editor' [英] Trouble on setting the git 'core.editor'
问题描述
我试图在我的Mac OS Snow Leopard 10.6.7上设置git,但是我做了一些错误......
此时,我有以下警告:
$ git config --global core.editor
EDITOR = / usr / bin / vim
错误:关键字core.editor有多个值:mate
$ git config --global core.editor open
warning: core.editor有多个值
我该如何解决这个问题?而且,大多数情况下,我怎样才能将 core.editor
设置为TextEdit并使其工作?
PS:I已经阅读 最简单的方法是将环境变量EDITOR更改为指向队友。在您的 并重新启动您的终端会话,或者源代码 至于你的错误信息: 这意味着您已经在.gitconfig中添加了多个core.editor行。 使用mate 然后使用 然后您可以离开 由于您要使用 这将适用于: I am trying to set git on my Mac Os Snow Leopard 10.6.7 but I made some errors on doing that... At this time I have the following warning: How can I solve that? And, mostly, how can I set the P.S.: I already read this question. The easiest way is to change the environment variable EDITOR to point to mate. In your and re-start your terminal session, or source the As for your error message: it means you've added multiple core.editor lines in your .gitconfig. Use mate Then use then you can leave If Since you want to use This will work for that:
这篇关于麻烦设置git'core.editor'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! .bash_profile
中添加以下内容:
export EDITOR =/ usr / local / bin / mate -w
.bash_profile
。
错误:关键的core.editor有多个值:mate
〜/ .gitconfig
修改你的 .gitconfig
并删除多余的行,或者如果你不介意不使用它们,请使用:
git config --global --unset-all core.editor
git config --global --add core.editor/ usr / local / bin / mate -w
$ EDITOR $如果
mate
$ b / code>不在 / usr / local / bin
中找到它的第一个地方是使用 type mate
(在bash中,不知道其他shell)
打开
作为你的 $ GIT_EDITOR
你需要以下内容:
-W导致打开,等待其打开的应用程序(或已打开的应用程序)退出。与-n标志一起使用,允许open作为$ EDITOR环境变量的适当应用程序。
-n即使已经运行了应用程序,也可以打开一个新的应用程序实例。
git config --global --unset-all core.editor
git config --global --add core.editoropen -W -n
code> $ git config --global core.editor
EDITOR=/usr/bin/vim
error: More than one value for the key core.editor: mate
$ git config --global core.editor open
warning: core.editor has multiple values
core.editor
to TextEdit and make it works?.bash_profile
add the following:export EDITOR="/usr/local/bin/mate -w"
.bash_profile
.error: More than one value for the key core.editor: mate
~/.gitconfig
to modify your .gitconfig
and remove the extra lines, or if you don't mind unsetting all of them use:git config --global --unset-all core.editor
git config --global --add core.editor "/usr/local/bin/mate -w"
$EDITOR
set to what it was previously set to.
mate
is not located in /usr/local/bin
find where it is first by using type mate
(in bash, not sure about other shells)
open
as your $GIT_EDITOR
you will need the following:-W Causes open to wait until the applications it opens (or that were already open) have exited. Use with the -n flag to allow open to function as an appropriate app for the $EDITOR environment variable.
-n Open a new instance of the application(s) even if one is already running.
git config --global --unset-all core.editor
git config --global --add core.editor "open -W -n"