如何使用Visual Studio Code作为Git的默认编辑器

本文介绍了如何在使用Git命令行时,将Visual Studio Code设置为默认编辑器,包括处理提交注释和查看文件差异。虽然目前不支持用VSCode进行合并,但可以通过修改.gitconfig文件来实现部分功能。更新表明,VSCode团队已经采纳了这一功能,未来版本将包括此功能。
摘要由CSDN通过智能技术生成

本文翻译自: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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值