【git】error There was a problem with the editor 'vi'.

Problem

MacのVimにてコミットメッセージを書いてwqするとこんなエラーが出た。

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

Solution

明示的に使用するエディタをvimの絶対パスを設定してあげればOK.

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

参考

Fixing "There was a problem with the editor 'vi'" for Git on Mac OS X Snow Leopard