LoginSignup
14
6

More than 5 years have passed since last update.

gitでコミットする時There was a problem with the editor 'vi' エラー解決法

Last updated at Posted at 2017-12-01

Mac環境でオプションなしgitコミットする時、以下のエラーが出る時があります。

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

どうやらvundleを使う時、vimrcをHPの勧めた通り設定したらエラーが出るらしいです(ソース

解決法

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

gitのデフォルトエディターであるviを呼び出す時、Macは代わりにvimを使います。ここでは直接デフォルトエディターをvimにしたらエラーを解消できました。
vimの居場所が/usr/bin/にない場合

git config --global core.editor $(which vim)

whichを使って取ってきます。
ちなみに

$ vim --version                                                                                                       
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 17 2017 11:21:47)
MacOS X (unix) version
14
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
6