简体   繁体   中英

Git-commit unable to open vim

Recently I installed bash-it into my terminal. Now, when I try to execute git commit the terminal shows me this error:

/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.

Before bash-it , the commit command correctly opened vim. Of course I've tried to change the core.editor in git to "vim" but it does not work anyway.

Could you please help me to solve this? I really like vim, it was super easy and fast...I don't want to use TextMate to edit the commit message.

PS: I'm using Mac OSX

Try using the below command. Should be able to set your editor back to vi or vim. However, you might have to give the absolute path to vim.

git config --global core.editor vim

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

As "abalos" answered,

git config --global core.editor vim

If you do not want to use vim or you do not have vim installed in some case, You can also use nano editor

git config --global core.editor nano

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM