Install Visual Studio Code as a Global Git Editor on OSX

I want VS Code to be my standard git editor for commands like rebase. This is not like the documentation on the VS Code website. I found a SO question on how to do this for Windows, which sounds like it has mixed success: How to use Visual Studio Code as the default editor for Git

Has anyone managed this on OSX?

+4
source share
4 answers

This is currently not possible with VS Code, but is planned for the future.

Update for our release of VS Code 1.0:

! , , Code git, --wait .

+3

OS X El Capitan (10.11.4) :

  • Visual Studio Studio OS X (, Applications /Applications)
  • vscode, Visual Studio ( "" ), ( ).

** ~/bin , :

cd ~ && mkdir bin

~/bin , :

ln -s /Applications/Visual \Studio\Code.app/Contents/Resources/app/bin/code ~/Bin/vscode

  1. /, Visual Studio, vscode .

vscode

  1. Visual Studio . , . ~/bin/ PATH OS X. ( ~/bin ?)
  2. git ~/.gitconfig , code. :

[]
editor = vscode --wait

git config --global core.editor "vscode --wait"

enter image description here

  1. . !. Visual Studio!
+1

"" VSCode (Shift + Command + P) enter image description here

then use these 2 lines in your terminal,

$ git config --global core.editor "code --wait"
$ git config --global -e

if you want to see the local git configuration,

$ cd /path/to/git/repo/
$ git config -e
+1
source

This work is for me.

Set the "code" from the VSCode commander (Shift + Command + P)

Search for:

Shell command: set the 'code' command to 'PATH'

Install it.

after that ... run commands on the terminal to configure git with a new editor:

$ git config --global core.editor "code --wait"
$ git config --global -e
0
source

Source: https://habr.com/ru/post/1623940/


All Articles