LoginSignup
29
24

More than 3 years have passed since last update.

GitのデフォルトエディタをVisual Studio Codeに設定

Posted at

目的

gitコマンドで使われるエディタをVisual Studio Codeに設定。

方法

  • Visual Studio Codeで「command + shift + p」でコマンドパレットを開き下記を実行する。

※windowsの場合は「Ctrl+Shift+P 」でコマンドパレットを開く。

Shell Command: Install 'Code' command in path

Screen Shot 2019-06-25 at 7.31.05.png

  • コマンドラインから下記のコマンドを実行する。
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.
29
24
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
29
24