Help us understand the problem. What is going on with this article?

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

目的

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.
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした