git 在 Windows10 上为 GitKraken 配置合并工具

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36667383/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:05:44  来源:igfitidea点击:

Configure a merge tool for GitKraken on Windows10

gitmergetool

提问by RabidTunes

I downloaded GitKraken for working with Git repositories and it works great for everything I need, but I haven't been able to configure it to use a merge tool like WinMerge or Meld.

我下载了 GitKraken 用于处理 Git 存储库,它非常适合我需要的一切,但我无法将其配置为使用 WinMerge 或 Meld 之类的合并工具。

When the program sees a conflict it shows up a button which says "Open in merge tool". Since I haven't configured a Merge tool, I head over GitKraken's preferences and checked out the "Merge tool" section. "Git Config Default" option was selected there and I could only choose "None" or "Git Config Default" options.

当程序发现冲突时,它会显示一个按钮,上面写着“在合并工具中打开”。由于我还没有配置合并工具,我浏览了 GitKraken 的首选项并查看了“合并工具”部分。在那里选择了“Git Config Default”选项,我只能选择“None”或“Git Config Default”选项。

I installed Meld for using it with GitKraken, and after that I tried to follow these stepsto make it usable within GitKraken's interface, but GitKraken's merge tool choice options haven't changed.

我安装了 Meld 以便与 GitKraken 一起使用,之后我尝试按照这些步骤使其在 GitKraken 的界面中可用,但 GitKraken 的合并工具选择选项没有改变。

After running a few commands from those steps and some others trying to make it work my .gitconfig file looks like this:

在从这些步骤运行一些命令和其他一些试图使其工作的命令后,我的 .gitconfig 文件如下所示:

[user]
    name = <myname>
    email = <mymail>
[filter "lfs"]
[filter "lfs"]
    clean = git-lfs clean %f
    smudge = git-lfs smudge %f
    required = true
[core]
    autocrlf = true
    excludesfile = C:\Users\<myuser>\Documents\gitignore_global.txt
[merge]
    tool = meld
[mergetool "meld"]
    path = C:\Program files (x86)\Meld\Meld.exe
[mergetool]
    prompt = false

I'm not really sure what I did and how to make it work... Anyone can help?

我不太确定我做了什么以及如何使它工作......任何人都可以帮忙吗?

采纳答案by wasatchwizard

GitKraken has finally added support for choosing one of the merge tools listed in your .gitconfigfile.

GitKraken 终于增加了对选择.gitconfig文件中列出的合并工具之一的支持。

enter image description here

在此处输入图片说明

回答by Bart Mensfort

ONly solution for GitKraken and Windows 10, which I can use:

GitKraken 和 Windows 10 的唯一解决方案,我可以使用:

Filename: C:\Users\my-name\.gitconfig

文件名:C:\Users\my-name\.gitconfig

Content:

内容:

[user]
    email = [email protected]
    name = Bart Houkes
[merge]
    tool = meld
[mergetool "meld"]
    path = C:/Program Files (x86)/Meld/Meld.exe
    cmd = \"C:/Program Files (x86)/Meld/Meld.exe\" --diff \"$BASE\" \"$LOCAL\" \"$REMOTE\" --output \"$MERGED\"

回答by poke

It seems that as of right now, GitKraken does not fully support all merge tools configured with git-configright now.

目前看来,GitKraken 并不完全支持git-config现在配置的所有合并工具。

In a comment to one of Axosoft's blog postsabout GitKraken, this was discussed:

对 Axosoft关于 GitKraken的一篇博客文章的评论中,讨论了这一点:

A User(February 29, 2016)

Any news when using a mergetool works? Is this yet missing or just bugged? I've configured a working mergetool in git global and it works calling it from console but gitkraken just does nothing when clicking "open in mergetool", not even an error message.


James(mod) (March 3, 2016)

There is a known issue with not being able to find the mergetool set and this will be addressed in an upcoming update!

一位用户(2016 年 2 月 29 日)

使用合并工具时有什么消息吗?这是还缺少还是只是被窃听了?我已经在 git global 中配置了一个有效的合并工具,它可以从控制台调用它,但是 gitkraken 在单击“在合并工具中打开”时什么也不做,甚至没有错误消息。


詹姆斯(修改版)(2016 年 3 月 3 日)

无法找到合并工具集是一个已知问题,这将在即将到来的更新中解决!

(For some reason, the Disqus plugin on that blog is not loading correctly right now, so you cannot see those comments. I had to look at a cached version from Google to see that)

(出于某种原因,该博客上的 Disqus 插件现在无法正确加载,因此您无法看到这些评论。我不得不查看 Google 的缓存版本才能看到这一点)

So it seems that you will have to wait until a future update for GitKraken to support meldor other merge tools (I also tested Beyond Compare on my machine). If KDiff3 works for you, then I guess you're lucky and you can use that for the time being.

如此看来,你将不得不等待,直到GitKraken未来的更新,以支持MELD或其他合并工具(我也测试超出了我的机器上进行比较)。如果 KDiff3 对你有用,那么我猜你很幸运,你可以暂时使用它。

回答by afrischk

I had the same problem. Try this in .gitconfig

我有同样的问题。在 .gitconfig 中试试这个

[merge]
    tool = meld
[mergetool "meld"]
    cmd = "C:\\Program Files (x86)\\Meld\\Meld"

Cheers

干杯

回答by user7245937

I had the same issue with meld as gitkraken external tool on ubuntu. I resolve that by symbolic link kdiff3 which point on meld binary. gitkraken support kdiff3.

我在 ubuntu 上遇到了与 gitkraken 外部工具一样的 meld 问题。我通过指向 meld 二进制文件的符号链接 kdiff3 解决了这个问题。gitkraken 支持 kdiff3。

Maybe it will work in the same way on windows. Try to rename meld.exe to kdiff3.exe or make shortcut and add to PATH. Marcin

也许它会在 Windows 上以同样的方式工作。尝试将 meld.exe 重命名为 kdiff3.exe 或创建快捷方式并添加到 PATH。马尔钦

回答by Jonathan Hult

For meldon Linux:

对于Linux 上的融合

[merge]
    tool = meld

[mergetool]
    keepBackup = false

[mergetool "meld"]
    path = /usr/bin/meld
    cmd = '/usr/bin/meld' --diff $BASE $LOCAL $REMOTE --output $MERGED
    trustExitCode = false

回答by buzz

for users of diffmerge, this addition to my ~/.gitconfig works for me:

对于 diffmerge 的用户,这个添加到我的 ~/.gitconfig 对我有用:

[merge]
tool = diffmerge
[mergetool "diffmerge"]
path = /usr/bin/diffmerge
cmd = /usr/bin/diffmerge \"$LOCAL\" \"$BASE\" \"$REMOTE\" -result \"$MERGED\"

回答by Leo Vun

just wanna update some... In my case, I installed KDiff3, Beyond Compare & Meld with reboot my window 10 as well. But I still didn't get the option in the dropdown box. But I realized I actually installed to my Z drive(which is my SSD drive I use for programming tools).

只是想更新一些......就我而言,我安装了 KDiff3、Beyond Compare & Meld,并重新启动了我的窗口 10。但是我仍然没有在下拉框中找到该选项。但我意识到我实际上安装到了我的 Z 驱动器(这是我用于编程工具的 SSD 驱动器)。

So I tried to remove and install back (KDiff3) to the default path C:\Program Files\KDiff3

Guess what? I had finally got it into the dropdown list. I didn't try out the other 2, but I guess It may happen when you installed to (maybe) the other drive or path.

你猜怎么着?我终于把它放到了下拉列表中。我没有尝试其他 2 个,但我猜当您安装到(也许)其他驱动器或路径时可能会发生这种情况。