#目的
gitコマンドで使われるエディタをVisual Studio Codeに設定。
#方法
- Visual Studio Codeで「command + shift + p」でコマンドパレットを開き下記を実行する。
※windowsの場合は「Ctrl+Shift+P 」でコマンドパレットを開く。
Shell Command: Install 'Code' command in path

- コマンドラインから下記のコマンドを実行する。
git config --global core.editor "code --wait"
- これでgit commitした際にVisual Studio Codeが起動すればOKです。
#補足
最初にコマンドパレットでインストールせずに、gitのeditorにcodeを設定してcommitすると以下の様なエラーが出てました。
同じエラーが出てた方はぜひ試してみてください。
error: There was a problem with the editor 'code'.
Please supply the message using either -m or -F option.