本文介绍了如何在Git扩展中使用Winmerge?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用,并预先安装并设置KDiff作为diff工具来解决合并冲突。我非常喜欢Winmerge,并希望用Winmerge替换KDiff。



在Git Extensions设置中,有一些设置可以更改Mergetool,但我可以' t似乎找出了我应该使用什么语法以及为什么。似乎有4个变量:$ BASE,$ LOCAL,$ REMOTE,$ MEDED。看来我应该将这些传递给WinMergeU.exe,但使用哪些命令行参数?



我尝试过搜索这几次,但没有看到实际可行的答案。

解决方案
以下是关于如何设置GIT版本控制的说明,以便您可以使用一组更好的工具比默认安装。该设置要求已安装GIT Extensions,并且需要在GIT扩展中配置Winmerge。



安装

浏览所有提示,并安装在Winmerge的默认目录中。



在GIT版本控制中配置Winmerge

在文本编辑器中打开一个新文档。
复制/粘贴以下内容并将文档另存为wMerge.sh到您的C:\程序文件(x86)\Git\bin\目录中。

  echo启动WinMerge:$ 1 $ 2C:/ Program Files(x86)/WinMerge/WinMergeU.exe-e -u -dl原始的-dr修改$ 1$ 2

转到您的用户 - >用户名目录并找到。 gitconfig文件。

  [user] 
name =输入您的姓名名称
email = [email protected]
[核心]
autocrlf = false
[合并]
工具= winmerge
[mergetoolwinmerge]
cmd = wMerge.sh \$ MERGED \\$ REMOTE\
path = c:/ Program Files(x86)/winmerge/winmergeu.exe
[ mergetool]
keepBackup = false
trustExitCode = false
[diff]
guitool = winmerge
[difftoolwinmerge]
path = c:/ Program文件(x86)/winmerge/winmergeu.exe
cmd = \c:/ Program Files(x86)/winmerge/winmergeu.exe\\$ LOCAL \\$ REMOTE\\ \\

运行GitExtensions,转到工具 - >设置 - > Git扩展 - > Git配置。
如果你已经正确完成你的安装并将这些工具引用到他们的目录中,你的全局设置页面应该如下所示(注意:请填写姓名和电子邮件地址):

mergetool: winmerge

mergetool的路径: c:/ Program Files(x86)/winmerge/winmergeu.exe

mergetool命令: wMerge.sh$ MERGED$ REMOTE

difftool: winmerge

difftool的路径: c:/ Program Files(x86)/winmerge/winmergeu.exe b $ b difftool命令:c:/ Program Files(x86)/winmerge/winmergeu.exe$ LOCAL$ REMOTE
line endings:按现状结帐,提交as $ is
导航至核对清单标签以验证GIT是否全部为绿色 并且满意你的设置。

I'm using Git Extensions and it pre-installs and sets up KDiff as the diff tool to solve merge conflicts. I'm very fond of Winmerge though and would like to replace KDiff with Winmerge.

In the Git Extensions settings, there are settings to change the Mergetool, but I can't seem to figure out what syntax I should use and why. There seem to be 4 variables: $BASE, $LOCAL, $REMOTE, $MERGED. It seems that I should pass these to WinMergeU.exe, but with which command line parameters?

I've tried to search for this a few times, but there is no answer that actually seems to work.

解决方案

Overview
The following is instructions on how to setup GIT Version Control so that you can use a better set of tools than the default installation. The setup requires that GIT Extensions is already installed and involves configuring Winmerge in GIT extensions.

Installation
Walk through all the prompts and install in the default directory for Winmerge.

Configure Winmerge in GIT Version Control
Open a new doc in a text editor.Copy/paste the following and save the document as "wMerge.sh" to your "C:\Program Files (x86)\Git\bin\" directory.

echo Launching WinMerge: $1 $2 "C:/Program Files (x86)/WinMerge/WinMergeU.exe" -e -u -dl "Original" -dr "Modified" "$1" "$2"

Goto your "Users->username" directory and locate the .gitconfig file. Open it in your favorite editor copy/paste the following code and Save:

[user]
    name = enter your name
    email = [email protected]
[core]
    autocrlf = false
[merge]
    tool = winmerge
[mergetool "winmerge"]
    cmd = wMerge.sh \"$MERGED\" \"$REMOTE\"
    path = c:/Program Files (x86)/winmerge/winmergeu.exe
[mergetool]
    keepBackup = false
    trustExitCode = false
[diff]
    guitool = winmerge
[difftool "winmerge"]
    path = c:/Program Files (x86)/winmerge/winmergeu.exe
    cmd = \"c:/Program Files (x86)/winmerge/winmergeu.exe\" \"$LOCAL\" \"$REMOTE\"

Run "GitExtensions", goto "tools->Settings->Git Extensions->Git Config". If you've done your installation properly and referenced the tools to their directory, your global settings page should look like below (NOTE: Please fill in your name on name and email):

mergetool: winmerge
path to mergetool: c:/Program Files (x86)/winmerge/winmergeu.exe
mergetool command: wMerge.sh "$MERGED" "$REMOTE"
difftool: winmerge
path to difftool: c:/Program Files (x86)/winmerge/winmergeu.exe
difftool command: "c:/Program Files (x86)/winmerge/winmergeu.exe" "$LOCAL" "$REMOTE"

line endings: checkout as-is, commit as-is

Navigate to the checklist tab to verify that GIT is all "green" and satisfied with your setup.

这篇关于如何在Git扩展中使用Winmerge?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 07:20