【发布时间】:2015-01-11 21:35:20
【问题描述】:
最近我在终端中安装了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。
当然,我尝试将 git 中的 core.editor 更改为“vim”,但它无论如何都不起作用。
你能帮我解决这个问题吗?我真的很喜欢 vim,它超级简单快捷……我不想使用 TextMate 来编辑提交消息。
PS:我使用的是 Mac OSX
【问题讨论】:
-
检查您的
EDITOR或VISUAL环境变量。其中一个可能指向/usr/bin/mate。 -
谢谢保罗,你是对的,我必须环境变量指向:
# Set my editor and git editor export EDITOR="/usr/bin/mate" export GIT_EDITOR='/usr/bin/mate -v'我编辑了我的 .bash_profile 并将其删除,设置 vim:# Set my editor and git editor export EDITOR="/usr/bin/vim" export GIT_EDITOR='/usr/bin/vim'
标签: git bash vim commit git-commit