Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git小问题-更改默认编辑器_Git_Textmate_Commit_Git Config - Fatal编程技术网

Git小问题-更改默认编辑器

Git小问题-更改默认编辑器,git,textmate,commit,git-config,Git,Textmate,Commit,Git Config,可能的重复项: 我正在尝试将我的默认git文本编辑器更改为TextMate,这样忘记提交时的-m标记将使我进入TextMate而不是vi [core] editor = mate -w 在我的~/.gitconfig中,但它仍然向我抛出以下错误: error: cannot run TextMate: No such file or directory error: There was a problem with the editor 'TextMate'. Please supply

可能的重复项:

我正在尝试将我的默认git文本编辑器更改为TextMate,这样忘记提交时的-m标记将使我进入TextMate而不是vi

[core]
editor = mate -w
在我的~/.gitconfig中,但它仍然向我抛出以下错误:

error: cannot run TextMate: No such file or directory
error: There was a problem with the editor 'TextMate'.
Please supply the message using either -m or -F option.

在如何设置/取消设置核心编辑器的各种指南中四处游荡,但找不到任何有效的方法,因此我来这里接受采访。

查看我在这个问题中的答案:


由于您已经正确设置了
$EDITOR
,只需从git中删除条目:

git config --global --unset-all core.editor

现在再次尝试git提交。

@karlphillip:TextMate在Mac上。
git config core.editor的输出是什么?
?要关闭投票者:引用的副本处理不同的内容,这个问题是关于一个特定的错误。也许我应该更清楚:我尝试了在上面找到的所有相关线程,但没有一个有效。包括上面链接的两个
git config core.editor:TextMate。
运行
mate
会打开TextMate,正如它应该的那样…
mate-w
功能完全符合预期。我假设这是一个简单的路由问题,但由于我对解决此类问题不太熟悉……此外:我的~/.bash_配置文件有:export EDITOR=“/usr/bin/mate-w”这应该是一个注释,而不是答案。请参阅上面的注释以了解我的澄清。@Nick Coelius:尝试我上面添加的命令,只需完全取消设置core.editor,因为您已经设置了
$editor
。这很有效,谢谢。我可以发誓我曾经尝试过,但失败了,但我想不会。