31

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

2
  • 1
    Check your EDITOR or VISUAL environment variables. One of them probably points to /usr/bin/mate. Commented Nov 14, 2014 at 13:21
  • Thanks Paul, you were right, i had to enviroment variables that pointer to: # Set my editor and git editor export EDITOR="/usr/bin/mate" export GIT_EDITOR='/usr/bin/mate -v' I edited my .bash_profile and deleted those to, set vim: # Set my editor and git editor export EDITOR="/usr/bin/vim" export GIT_EDITOR='/usr/bin/vim' Commented Nov 14, 2014 at 13:37

4 Answers 4

56

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
Sign up to request clarification or add additional context in comments.

2 Comments

As i said, my core.editor was already set to vim, the problem was that i had to enviroment vars that pointed to /usr/bin/mate in my .bash_profile
For me this fixed the issue of when I tried to rebase a text file would be opened in my editor, I needed to use vim for renaming the commit messages and traverse the most recent few commits
11

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

1 Comment

I have set git config --global core.editor subl but still getting errors. ``` git commit fatal: cannot run subl: No such file or directory error: unable to start editor 'subl' Please supply the message using either -m or -F option. ```
9

If other answers don't work, try export GIT_EDITOR=vim

1 Comment

I have used it recently; and it works pretty well!
2

the problem was that i had two environment variables that pointed to /usr/bin/mate in my .bash_profile so i edit them to point to vim

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.