I want to set VS Code to be my default git editor for commands such as rebase. This doesn\'t seem to be documented on the VS Code website. I\'ve found a SO question about do
Install "code" from VSCode commander(Shift + Command + P)
then use these 2 lines in your terminal,
$ git config --global core.editor "code --wait"
$ git config --global -e
if you want to see local git config,
$ cd /path/to/git/repo/
$ git config -e
Under OS X El Capitan (10.11.4) I was able to setup the whole thing:
/Applications
)vscode
that links to your Visual Studio (inside Applications folder)using below command (be sure to use correct paths). ** If ~/bin folder doesn't exists, just create it:
cd ~ && mkdir bin
If folder ~/bin exists just create a link:
ln -s /Applications/Visual\Studio\Code.app/Contents/Resources/app/bin/code ~/bin/vscode
vscode
in terminal window. vscode
~/bin/
to your PATH under OS X. Follows this (How do I add ~/bin to my path?)~/.gitconfig
and set editor using code
name. In my case it looks like this:[core]
editor = vscode --wait
OR type
git config --global core.editor "vscode --wait"
This is currently not possible with VS Code but planned for the future.
Update for our VS Code 1.0 release:
This is now possible! All you need to do is to configure Code as the git editor using the newly introduced --wait
option from the command line.
This work for me.
Install "code" from VSCode commander (Shift + Command + P)
Search for:
Shell Command: Install 'code' command in 'PATH'
Install it.
after that… run commands on terminal for config git with new editor:
$ git config --global core.editor "code --wait"
$ git config --global -e