git 设置 mergetool,difftool 为 BeyondCompare

卖一下广告,欢迎大家关注我的微信公众号,扫一扫下方二维码或搜索微信号 stormjun,即可关注。 目前专注于 Android 开发,主要分享 Android开发相关知识和一些相关的优秀文章,包括个人总结,职场经验等。

前言

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

第一种方法

使用命令行配置:

windows

difftool

git config --global diff.tool bc3 
git config --global difftool.bc3.path "bcomp.exe的路径"

mergetool

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,那么我可以这样配置

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 使用说明

[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

  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

gdutxiaoxu

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值