LoginSignup
0
0

More than 1 year has passed since last update.

【エラー備忘録】git commit時にエディタが開かない There was a problem with the editor 'code --wait'

Posted at

状況・エラー文

はじめて$ git commitコマンドを使う際、コミットメッセージを登録するためのエディタが開かない。
ターミナルには以下のエラーメッセージ。

$ git commit

hint: Waiting for your editor to close the file... code --wait: code: command not found
error: There was a problem with the editor 'code --wait'.
Please supply the message using either -m or -F option.

原因・解決策

code: command not foundとあるので、vscodeのPathが原因と思われる。 
vscodeを開いて設定を行う。

コマンドパレッド(Shift+Command+p)より、シェルコマンド PATH内にcodeコマンドをインストールしますを選択してインストールすると、解決した。

error: unable to start editorとなる場合は、configの設定が必要。

$ git config --global core.editor 'code --wait'

参考記事

0
0
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
0
0