[Git] Solution for "error: There was a problem with the editor 'vi'" Error

Tadashi Shigeoka ·  Thu, April 12, 2012

In Git, I encountered an error when I tried to commit with git commit, wrote a comment in Vim, and then attempted to commit.

Git

Error Message

$ git commit
error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.

Setting the editor to be used by Git should solve this.

Check Vim Path

$ which vim
/usr/local/bin/vim

Set Git Core Editor to Vim

$ git config --global core.editor "/usr/local/bin/vim"

That’s all from the Gemba.

Reference Information

When git commit Results in Error After Editor Editing - tentete’s Diary