Git-commit无法打开vim

imr*_*an3 11 git vim bash commit git-commit

最近我安装bash-it到我的终端.现在,当我尝试执行git commit终端时显示我的错误:

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

之前bash-it,commit命令正确打开了vim.当然我已经尝试将core.editorin git 更改为"vim",但无论如何它都无法正常工作.

你能帮我解决这个问题吗?我非常喜欢vim,它非常简单快速...我不想使用TextMate来编辑提交消息.

PS:我正在使用Mac OSX

aba*_*los 23

尝试使用以下命令.应该能够将编辑器设置回vi或vim.但是,您可能必须提供vim的绝对路径.

git config --global core.editor vim
Run Code Online (Sandbox Code Playgroud)


小智 8

如果其他答案不起作用,请尝试export GIT_EDITOR=vim


Ste*_*sic 6

正如“abalos”所回答的那样,

git config --global core.editor vim
Run Code Online (Sandbox Code Playgroud)

如果您不想使用vimvim在某些情况下没有安装,您也可以使用nano编辑器

git config --global core.editor nano
Run Code Online (Sandbox Code Playgroud)


imr*_*an3 2

问题是我有两个环境变量指向/usr/bin/mate我的.bash_profile 所以我编辑它们以指向vim