git 配置第三方比较工具(2)

转载:https://blog.csdn.net/qfturauyls/article/details/109371860

配置

3.2:在~/.gitconfig中添加如下配置。

[diff]
    tool = bcomp
[difftool "bcomp"]
    cmd = \"/usr/local/bin/bcomp\" \"$LOCAL\" \"$REMOTE\"
[difftool]
    prompt = false
[merge]
    tool = bcomp
[mergetool]
    prompt = false
[mergetool "bcomp"]
    cmd = \"/usr/local/bin/bcomp\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"

附上我自己的

[user]
[core]
    quotepath = false
[credential]
[user]
    name = ***
    email = ***
[credential]
    helper = store
[diff]
    tool = bcomp
[difftool "bcomp"]
    cmd = \"/usr/bin/bcompare\" \"$LOCAL\" \"$REMOTE\"
[difftool]
    prompt = false

使用

git difftool --dir-diff 版本1 版本2
git difftool -d 版本1 版本2
git diff :默认查看当前修改并且没有add 的内容
git diff --cached :查看已经add 并且没有commit 的内容
git diff HEAD 是上面查看上面两种条件的并集。

参考
https://git-scm.com/docs/git-difftool

posted @ 2024-01-25 13:09  sgggr  阅读(61)  评论(0编辑  收藏  举报