本文翻译自:How to use Visual Studio Code as Default Editor for Git
When using git at the command line, I am wondering if it is possible to use Visual Studio Code as the default editor, ie when creating commit comments, and looking at a diff of a file from the command line. 在命令行上使用git时,我想知道是否可以将Visual Studio Code用作默认编辑器,即创建提交注释并从命令行查看文件的差异时。
I understand that it won't be possible to use it for doing merges (at least at the minute) but does anyone know if it is possible to use it for looking at diff's, and if so, what command line options would be required in the .gitconfig file to make this happen? 我知道将无法使用它进行合并(至少在当前时间),但是没有人知道是否可以使用它来查看差异,如果可以的话,将需要使用哪些命令行选项.gitconfig文件来实现这一目标?
UPDATE 1: 更新1:
I have tried an approach similar to what I have done for Notepad++ in the past , ie 我尝试过一种类似于过去对Notepad ++所做的方法,即
#!/bin/sh
"c:/Program Files (x86)/Notepad++/notepad++.exe" -multiInst -notabbar -nosession -noPlugin "$*"
And used: 并用于:
#!/bin/sh
"C:\Users\gep13\AppData\Local\Code\app-0.1.0\Code.exe" "$*"
But