Visual Studio Code for Mac 作为 Sourcetree 中的差异/合并工具 [英] Visual Studio Code for Mac as diff/merge tool in Sourcetree
问题描述
是否可以将 Visual Studio Code 设置为 Mac 上 Sourcetree 中的默认差异/合并工具?
Is there a way that I can set Visual Studio Code as the default diff/merge tool in Sourcetree on Mac?
推荐答案
你需要在Sourcetree中做如下配置
You need to do below configuration in Sourcetree
- 转到 Sourcetree → 首选项 → 差异
- 在外部差异/合并部分中,为可视差异工具和合并工具选择自定义
Diff 参数 →
--diff --wait "$LOCAL" "$REMOTE"
- Go to Sourcetree → Preferences → Diff
- In the section External Diff / Merge, select Custom for the Visual Diff Tool and Merge Tool
Diff Arguments →
--diff --wait "$LOCAL" "$REMOTE"
合并 参数 → -n --wait "$MERGED"
保存配置后,转到源树并右键单击有合并冲突的文件解决冲突→启动外部合并工具
After configuration is saved, then goto the Sourcetree and right click on the file with merge conflicts Resolve Conflicts → Launch External Merge Tool
注意:Diff 和 Merge 命令应该指向 /usr/local/bin/code
而不是 code
> 否则将无法运行
Note: Diff and Merge command should point to
/usr/local/bin/code
and notcode
otherwise it will not work
这篇关于Visual Studio Code for Mac 作为 Sourcetree 中的差异/合并工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!