Git:如何将KDiff3配置为合并工具和差异工具 [英] Git: How configure KDiff3 as merge tool and diff tool

查看:1664
本文介绍了Git:如何将KDiff3配置为合并工具和差异工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我使用的是GitExtension 2.46,但是具有相同的Git版本是1.9.4.msysgit.2。只愿意使用Git命令,我卸载了GitExtension并安装了可用的 Git KDiff3



当我进行合并并发生冲突时,我运行以下命令:

  $ git mergetool 

然后我收到消息:


合并工具kdiff3不可用作'kdiff3'。


我猜它必须是KDiff3路径。



环境


  • 操作系统:Windows 10

  • Git 2.6.1.windows.1

  • KDiff3 0.9.98(64位)



问题:




  • 我必须在.gitconfig文件中为 $ git mergetool 打开版本 LOCAL , REMOTE BASE MERGED

  • >

    这些网站非常有帮助,差不多, mergetool difftool 。我使用了全局配置,但可以在没有问题的情况下由存储库使用。您只需执行以下命令:

      git config --global --add merge.tool kdiff3 
    git config --global --add mergetool.kdiff3.pathC:/ Program Files / KDiff3 / kdiff3.exe
    git config --global --add mergetool.kdiff3.trustExitCode false

    git config --global --add diff.guitool kdiff3
    git config --global --add difftool.kdiff3.pathC:/ Program Files / KDiff3 / kdiff3.exe
    git config - -global --add difftool.kdiff3.trustExitCode false

    使用 trustExitCode 选项取决于diff工具返回时您想要执行的操作。从文档: p>


    git-difftool 在每个文件上分别调用diff工具。默认情况下,diff工具报告的错误将被忽略。当调用的差异工具返回非零退出代码时,使用 - 信任退出代码使 git-difftool 退出。



    Recently I was using GitExtension 2.46, but the Git version that has the same is 1.9.4.msysgit.2. Willing to use only Git commands, I uninstalled GitExtension and install the latest version available of Git and KDiff3.

    When I make a merge and have conflicts, I run the following command:

    $ git mergetool
    

    Then I receive the message:

    The merge tool kdiff3 is not available as 'kdiff3'.

    I guess it must be by the KDiff3 path.

    Environment

    • OS: Windows 10
    • Git 2.6.1.windows.1
    • KDiff3 0.9.98 (64 bit)

    Questions:

    • What do I have to configure in the .gitconfig file for the command $ git mergetool to open the KDiff3 GUI with the versions LOCAL, REMOTE, BASE and MERGED of conflicted file?

    • How configure it to use it has diff-tool?

    解决方案

    These sites were very helpful, almost, mergetool and difftool. I used the global configuration, but can be used by repository without problems. You just need to execute the following commands:

    git config --global --add merge.tool kdiff3
    git config --global --add mergetool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
    git config --global --add mergetool.kdiff3.trustExitCode false
    
    git config --global --add diff.guitool kdiff3
    git config --global --add difftool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
    git config --global --add difftool.kdiff3.trustExitCode false
    

    The use of the trustExitCode option depends on what you want to do when diff tool returns. From documentation:

    git-difftool invokes a diff tool individually on each file. Errors reported by the diff tool are ignored by default. Use --trust-exit-code to make git-difftool exit when an invoked diff tool returns a non-zero exit code.

    这篇关于Git:如何将KDiff3配置为合并工具和差异工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆