前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >git 设置 mergetool,difftool 为 BeyondCompare

git 设置 mergetool,difftool 为 BeyondCompare

作者头像
程序员徐公
发布2018-09-18 16:51:45
1.3K0
发布2018-09-18 16:51:45
举报

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://cloud.tencent.com/developer/article/1341872

前言

在工作中,使用 git 的时候,我们大多数情况下都会使用一些可视化工具,比如 TortoiseGit,SourceTree 等等。但是,有时候,我们也会使用 git 命令行,比如结合 gerrit 使用的时候。今天,我们就来说说怎样配置 git 的 mergetool,difftool,一共有两种方式。

第一种方法

使用命令行配置:

windows

difftool

代码语言:javascript
复制
git config --global diff.tool bc3 
git config --global difftool.bc3.path "bcomp.exe的路径"

mergetool

代码语言:javascript
复制
git config --global merge.tool bc3 
git config --global mergetool.bc3.path "bcomp.exe的路径"

举个例子,比如我电脑 bcomp.exe的路径 为 D:\Program Files (x86)\Beyond Compare 3\BComp.exe,那么我可以这样配置

代码语言:javascript
复制
git config --global merge.tool bc3 
git config --global mergetool.bc3.path "D:\\Program Files (x86)\\Beyond Compare 3\\BComp.exe"

第二种方法

直接在 gitconfig 文件配置,可以在 C:\Users{UserName}.gitconfig 文件中配置。如果想要了解更多 gitConfig ,可以阅读我的这一篇博客 Git config 使用说明

代码语言:javascript
复制
[merge]
    tool = bc3
[mergetool "bc3"]
    path = D:\\Program Files (x86)\\Beyond Compare 3\\BComp.exe
[diff]
    tool = bc3
[difftool "bc3"]
    path = D:\\Program Files (x86)\\Beyond Compare 3\\BComp.exe

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018年05月25日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 前言
  • 第一种方法
  • 第二种方法
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档