Windows 上的 Git:如何设置合并工具?

发布于 2024-07-11 15:43:02 字数 163 浏览 6 评论 0原文

我在 Cygwin 上尝试过 msysGit 和 Git。 两者本身都工作得很好,并且都完美地运行 gitk 和 git-gui。

现在我到底该如何配置合并工具呢? (Vimdiff 可以在 Cygwin 上运行,但我希望对于一些喜欢 Windows 的同事来说,它能更加用户友好。)

I've tried msysGit and Git on Cygwin. Both work just fine in and of themselves and both run gitk and git-gui perfectly.

Now how the heck do I configure a mergetool? (Vimdiff works on Cygwin, but preferably I would like something a little more user-friendly for some of our Windows-loving coworkers.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(19

漆黑的白昼 2024-07-18 15:43:02

为了跟进 Charles Bailey 的答案,这是我使用 p4merge(免费的跨平台 3way 合并工具); 在 msys Git (Windows) 安装上进行测试:

git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd 'p4merge.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"'

或者,从 Windows cmd.exe shell 中,第二行变为:

git config --global mergetool.p4merge.cmd "p4merge.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\""

更改(相对于 Charles Bailey):

  • 添加到全局 git 配置,即对所有 git 项目有效,而不仅仅是当前项目
  • 自定义工具配置值驻留在“mergetool.[tool].cmd”中,而不是“merge.[tool].cmd”(愚蠢的我,花了一个小时排除为什么 git 一直抱怨不存在的工具)
  • 为所有添加了双引号文件名,以便合并工具仍然可以找到带空格的文件(我在 Powershell 的 msys Git 中测试了这一点)
  • 请注意,默认情况下 Perforce 会将其安装目录添加到 PATH,因此无需在命令中指定 p4merge 的完整路径

下载:http://www.perforce.com/product /components/perforce-visual-merge-and-diff-tools


编辑(2014 年 2 月)

正如 @Gregory Pakosz,最新的msys git 现在“原生”支持p4merge(在 1.8.5.2.msysgit.0 上测试)。

您可以通过运行以下命令来显示支持的工具列表:

git mergetool --tool-help

您应该在可用有效列表中看到p4merge。 如果没有,请更新你的 git。

如果p4merge被列为可用,那么它就在您的PATH中,您只需设置merge.tool

git config --global merge.tool p4merge

如果它被列为有效,除了merge.tool之外,您还必须定义mergetool.p4merge.path

git config --global mergetool.p4merge.path c:/Users/my-login/AppData/Local/Perforce/p4merge.exe
  • 上面是一个示例路径当为当前用户安装 p4merge 时,而不是系统范围内(不需要管理员权限或 UAC 提升),
  • 尽管 ~ 应该扩展到当前用户的主目录(因此理论上路径应该是 ~/AppData/Local/Perforce/p4merge.exe),这对我来说不起作用
  • 更好的是利用环境变量(例如 $LOCALAPPDATA/Perforce/p4merge.exe),git 似乎没有扩展路径的环境变量(如果您知道如何使其工作,请让我知道或更新此答案)

To follow-up on Charles Bailey's answer, here's my git setup that's using p4merge (free cross-platform 3way merge tool); tested on msys Git (Windows) install:

git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd 'p4merge.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"'

or, from a windows cmd.exe shell, the second line becomes :

git config --global mergetool.p4merge.cmd "p4merge.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\""

The changes (relative to Charles Bailey):

  • added to global git config, i.e. valid for all git projects not just the current one
  • the custom tool config value resides in "mergetool.[tool].cmd", not "merge.[tool].cmd" (silly me, spent an hour troubleshooting why git kept complaining about non-existing tool)
  • added double quotes for all file names so that files with spaces can still be found by the merge tool (I tested this in msys Git from Powershell)
  • note that by default Perforce will add its installation dir to PATH, thus no need to specify full path to p4merge in the command

Download: http://www.perforce.com/product/components/perforce-visual-merge-and-diff-tools


EDIT (Feb 2014)

As pointed out by @Gregory Pakosz, latest msys git now "natively" supports p4merge (tested on 1.8.5.2.msysgit.0).

You can display list of supported tools by running:

git mergetool --tool-help

You should see p4merge in either available or valid list. If not, please update your git.

If p4merge was listed as available, it is in your PATH and you only have to set merge.tool:

git config --global merge.tool p4merge

If it was listed as valid, you have to define mergetool.p4merge.path in addition to merge.tool:

git config --global mergetool.p4merge.path c:/Users/my-login/AppData/Local/Perforce/p4merge.exe
  • The above is an example path when p4merge was installed for the current user, not system-wide (does not need admin rights or UAC elevation)
  • Although ~ should expand to current user's home directory (so in theory the path should be ~/AppData/Local/Perforce/p4merge.exe), this did not work for me
  • Even better would have been to take advantage of an environment variable (e.g. $LOCALAPPDATA/Perforce/p4merge.exe), git does not seem to be expanding environment variables for paths (if you know how to get this working, please let me know or update this answer)
原野 2024-07-18 15:43:02

设置 mergetool.p4merge.cmd 将不再起作用,因为 Git 已经开始尝试支持 p4merge,请参阅 libexec/git-core/git-mergetool--lib. 所以我们只需要指定 git 的 mergetool 路径,例如 p4merge:

git config --global mergetool.p4merge.path 'C:\Program Files\Perforce\p4merge.exe'
git config --global merge.tool p4merge

然后它就会起作用。

setting mergetool.p4merge.cmd will not work anymore since Git has started trying to support p4merge, see libexec/git-core/git-mergetool--lib.so we just need to specify the mergetool path for git,for example the p4merge:

git config --global mergetool.p4merge.path 'C:\Program Files\Perforce\p4merge.exe'
git config --global merge.tool p4merge

Then it will work.

放飞的风筝 2024-07-18 15:43:02

我在 WinXP 上使用 Portable Git(很好用!),并且需要解决分支中出现的冲突。 在我检查过的所有 gui 中,KDiff3 被证明是使用起来最透明的。

但我在 这篇博文,说明与此处列出的其他方法略有不同。 它基本上相当于将这些行添加到我的 .gitconfig 文件中:

[merge]
    tool = kdiff3

[mergetool "kdiff3"]
    path = C:/YourPathToBinaryHere/KDiff3/kdiff3.exe
    keepBackup = false
    trustExitCode = false

现在工作正常!

I'm using Portable Git on WinXP (works a treat!), and needed to resolve a conflict that came up in branching. Of all the gui's I checked, KDiff3 proved to be the most transparent to use.

But I found the instructions I needed to get it working in Windows in this blog post, instructions which differ slightly from the other approaches listed here. It basically amounted to adding these lines to my .gitconfig file:

[merge]
    tool = kdiff3

[mergetool "kdiff3"]
    path = C:/YourPathToBinaryHere/KDiff3/kdiff3.exe
    keepBackup = false
    trustExitCode = false

Working nicely now!

疯了 2024-07-18 15:43:02

在 Cygwin 下,唯一对我有用的事情如下:

git config --global merge.tool myp4merge
git config --global mergetool.myp4merge.cmd 'p4merge.exe "$(cygpath -wla $BASE)" "$(cygpath -wla $LOCAL)" "$(cygpath -wla $REMOTE)" "$(cygpath -wla $MERGED)"'
git config --global diff.tool myp4diff
git config --global difftool.myp4diff.cmd 'p4merge.exe "$(cygpath -wla $LOCAL)" "$(cygpath -wla $REMOTE)"'

另外,我喜欢关闭 difftool 的提示消息:

git config --global difftool.prompt false

Under Cygwin, the only thing that worked for me is the following:

git config --global merge.tool myp4merge
git config --global mergetool.myp4merge.cmd 'p4merge.exe "$(cygpath -wla $BASE)" "$(cygpath -wla $LOCAL)" "$(cygpath -wla $REMOTE)" "$(cygpath -wla $MERGED)"'
git config --global diff.tool myp4diff
git config --global difftool.myp4diff.cmd 'p4merge.exe "$(cygpath -wla $LOCAL)" "$(cygpath -wla $REMOTE)"'

Also, I like to turn off the prompt message for difftool:

git config --global difftool.prompt false
汹涌人海 2024-07-18 15:43:02

git mergetool 是完全可配置的,因此您几乎可以选择自己喜欢的工具。

完整的文档在这里: http://www.kernel .org/pub/software/scm/git/docs/git-mergetool.html

简而言之,您可以通过设置用户配置变量 merge.tool 来设置默认合并工具。

如果合并工具是其本机支持的工具之一,您只需将 mergetool..path 设置为该工具的完整路径(替换 < /code> 您已配置的 merge.tool

否则,您可以将 mergetool..cmd 设置为要 eval 的一些 shell'在运行时将 shell 变量 $BASE、$LOCAL、$REMOTE、$MERGED 设置为适当的文件,无论是直接编辑配置文件还是设置,都必须小心转义。使用 git config 命令的变量

应该能体现出您可以做什么(“mymerge”是一个虚构的工具)

git config merge.tool mymerge
git config merge.mymerge.cmd 'mymerge.exe --base "$BASE" "$LOCAL" "$REMOTE" -o "$MERGED"'

。每当有冲突需要解决时,运行 git mergetool 就可以了

Perforce 的 p4merge 工具是一个非常好的独立合并工具。

git mergetool is fully configurable so you can pretty much chose your favourite tool.

The full documentation is here: http://www.kernel.org/pub/software/scm/git/docs/git-mergetool.html

In brief, you can set a default mergetool by setting the user config variable merge.tool.

If the merge tool is one of the ones supported natively by it you just have to set mergetool.<tool>.path to the full path to the tool (replace <tool> by what you have configured merge.tool to be.

Otherwise, you can set mergetool.<tool>.cmd to a bit of shell to be eval'ed at runtime with the shell variables $BASE, $LOCAL, $REMOTE, $MERGED set to the appropriate files. You have to be a bit careful with the escaping whether you directly edit a config file or set the variable with the git config command.

Something like this should give the flavour of what you can do ('mymerge' is a fictional tool).

git config merge.tool mymerge
git config merge.mymerge.cmd 'mymerge.exe --base "$BASE" "$LOCAL" "$REMOTE" -o "$MERGED"'

Once you've setup your favourite merge tool, it's simply a matter of running git mergetool whenever you have conflicts to resolve.

The p4merge tool from Perforce is a pretty good standalone merge tool.

白龙吟 2024-07-18 15:43:02

在 Windows 7 上无与伦比

git config --global merge.tool bc3
git config --global mergetool.bc3.path "C:\Program Files (x86)\Beyond Compare 3\BCompare.exe"

For beyond compare on Windows 7

git config --global merge.tool bc3
git config --global mergetool.bc3.path "C:\Program Files (x86)\Beyond Compare 3\BCompare.exe"
浮华 2024-07-18 15:43:02

似乎较新的 git 版本直接支持 p4merge,所以

git config --global merge.tool p4merge

如果 p4merge.exe 在您的路径上,那么这应该是您所需要的。 无需设置cmd或路径。

It seems that newer git versions support p4merge directly, so

git config --global merge.tool p4merge

should be all you need, if p4merge.exe is on your path. No need to set up cmd or path.

执妄 2024-07-18 15:43:02

我发现有两种方法可以在 github Windows 中将“SourceGear DiffMerge”配置为 difftool 和 mergetool。

命令提示符窗口中的以下命令将更新您的 .gitconfig 以使用 DiffMerge 配置 GIT:

git config --global diff.tool diffmerge
git config --global difftool.diffmerge.cmd 'C:/Program\ Files/SourceGear/Common/DiffMerge/sgdm.exe  \"$LOCAL\" \"$REMOTE\"'

git config --global merge.tool diffmerge
git config --global mergetool.diffmerge.cmd  'C:/Program\ Files/SourceGear/Common/DiffMerge/sgdm.exe  -merge  -result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"'

[OR]

将以下行添加到您的 .gitconfig。 该文件应位于您的主目录 C:\Users\UserName 中:

[diff]
    tool = diffmerge
[difftool "diffmerge"]
    cmd = C:/Program\\ Files/SourceGear/Common/DiffMerge/sgdm.exe \"$LOCAL\" \"$REMOTE\"

[merge]
    tool = diffmerge
[mergetool "diffmerge"]
    trustExitCode = true
    cmd = C:/Program\\ Files/SourceGear/Common/DiffMerge/sgdm.exe -merge -result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"

I found two ways to configure "SourceGear DiffMerge" as difftool and mergetool in github Windows.

The following commands in a Command Prompt window will update your .gitconfig to configure GIT use DiffMerge:

git config --global diff.tool diffmerge
git config --global difftool.diffmerge.cmd 'C:/Program\ Files/SourceGear/Common/DiffMerge/sgdm.exe  \"$LOCAL\" \"$REMOTE\"'

git config --global merge.tool diffmerge
git config --global mergetool.diffmerge.cmd  'C:/Program\ Files/SourceGear/Common/DiffMerge/sgdm.exe  -merge  -result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"'

[OR]

Add the following lines to your .gitconfig. This file should be in your home directory in C:\Users\UserName:

[diff]
    tool = diffmerge
[difftool "diffmerge"]
    cmd = C:/Program\\ Files/SourceGear/Common/DiffMerge/sgdm.exe \"$LOCAL\" \"$REMOTE\"

[merge]
    tool = diffmerge
[mergetool "diffmerge"]
    trustExitCode = true
    cmd = C:/Program\\ Files/SourceGear/Common/DiffMerge/sgdm.exe -merge -result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"
羁绊已千年 2024-07-18 15:43:02

正如此处已经回答的那样(以及此处此处),mergetool是配置它的命令。 对于一个漂亮的图形前端,我推荐 kdiff3 (GPL)。

As already answered here (and here and here), mergetool is the command to configure this. For a nice graphical frontend I recommend kdiff3 (GPL).

○愚か者の日 2024-07-18 15:43:02

我不得不在 Windows 7 上使用 msysGit 删除额外的引用,不知道为什么。

git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd 'p4merge $BASE $LOCAL $REMOTE $MERGED'

I had to drop the extra quoting using msysGit on windows 7, not sure why.

git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd 'p4merge $BASE $LOCAL $REMOTE $MERGED'
や莫失莫忘 2024-07-18 15:43:02

如果您通过 cygwin 执行此操作,则可能需要使用 cygpath:

git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd 'p4merge `cygpath -w $BASE` `cygpath -w $LOCAL` `cygpath -w $REMOTE` `cygpath -w $MERGED`'

If you're doing this through cygwin, you may need to use cygpath:

git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd 'p4merge `cygpath -w $BASE` `cygpath -w $LOCAL` `cygpath -w $REMOTE` `cygpath -w $MERGED`'
油焖大侠 2024-07-18 15:43:02

啊,这终于对我有用(Windows 7 + Cygwin + TortoiseMerge):

在.git/config中:

cmd = TortoiseMerge.exe /base:$(cygpath -d \"$BASE\") /theirs:$(cygpath -d \"$REMOTE\") /mine:$(cygpath -d \"$LOCAL\") /merged:$(cygpath -d \"$MERGED\")

感谢之前的海报提供了使用cygpath的提示!

Bah, this finally worked for me (Windows 7 + Cygwin + TortoiseMerge):

In .git/config:

cmd = TortoiseMerge.exe /base:$(cygpath -d \"$BASE\") /theirs:$(cygpath -d \"$REMOTE\") /mine:$(cygpath -d \"$LOCAL\") /merged:$(cygpath -d \"$MERGED\")

Thanks to previous posters for the tip to use cygpath!

无需解释 2024-07-18 15:43:02

我使用一个名为 WinMerge 的应用程序 ( http://winmerge.org/ )
来自他们的手册的信息( http://manual.winmerge.org/CommandLine.html

这是我通过 .gitconfigmergetool 指令使用的 bash 脚本

#!/bin/sh
# using winmerge with git
# replaces unix style null files with a newly created empty windows temp file

file1=$1
if [ "$file1" == '/dev/null' ] || [ "$file1" == '\\.\nul' ] || [ ! -e "$file1" ]
    then 
       file1="/tmp/gitnull"
       `echo "">$file1`
fi
file2=$2
if [ "$file2" == '/dev/null' ] || [ "$file2" == '\\.\nul' ] || [ ! -e "$file2" ]
    then 
       file2="/tmp/gitnull"
       `echo "">$file2`
fi
echo diff : $1 -- $2
"C:\Program files (x86)\WinMerge\WinMergeU.exe" -e -ub -dl "Base" -dr "Mine" "$file1" "$file2"

基本上说明了 bash 何时将 diff 的结果放入空文件中,并以正确的方式创建新的临时文件地点。

i use an app called WinMerge ( http://winmerge.org/ )
info from their manual ( http://manual.winmerge.org/CommandLine.html )

this is the bash script i use from the mergetool directive via .gitconfig

#!/bin/sh
# using winmerge with git
# replaces unix style null files with a newly created empty windows temp file

file1=$1
if [ "$file1" == '/dev/null' ] || [ "$file1" == '\\.\nul' ] || [ ! -e "$file1" ]
    then 
       file1="/tmp/gitnull"
       `echo "">$file1`
fi
file2=$2
if [ "$file2" == '/dev/null' ] || [ "$file2" == '\\.\nul' ] || [ ! -e "$file2" ]
    then 
       file2="/tmp/gitnull"
       `echo "">$file2`
fi
echo diff : $1 -- $2
"C:\Program files (x86)\WinMerge\WinMergeU.exe" -e -ub -dl "Base" -dr "Mine" "$file1" "$file2"

basically the bash accounts for when the result of the diff in an empty file and creates a new temp file in the correct location.

一直在等你来 2024-07-18 15:43:02

您可能也想添加这些选项:

git config --global merge.tool p4mergetool
git config --global mergetool.p4merge.cmd 'p4merge $BASE $LOCAL $REMOTE $MERGED'
git config --global mergetool.p4mergetool.trustExitCode false
git config --global mergetool.keepBackup false

另外,我不知道为什么,但米兰加迪安答案中的引用和斜杠把事情搞砸了。

You may want to add these options too:

git config --global merge.tool p4mergetool
git config --global mergetool.p4merge.cmd 'p4merge $BASE $LOCAL $REMOTE $MERGED'
git config --global mergetool.p4mergetool.trustExitCode false
git config --global mergetool.keepBackup false

Also, I don't know why but the quoting and slash from Milan Gardian's answer screwed things up for me.

﹎☆浅夏丿初晴 2024-07-18 15:43:02

如果有人想使用 gvim 作为 TortoiseGit 上的 diff 工具,那么您需要在文本输入中输入外部 diff 工具的路径:

path\to\gvim.exe -f -d -c "wincmd R" -c "wincmd R" -c "wincmd h" -c "wincmd J"

If anyone wants to use gvim as their diff tool on TortoiseGit, then this is what you need to enter into the text input for the path to the external diff tool:

path\to\gvim.exe -f -d -c "wincmd R" -c "wincmd R" -c "wincmd h" -c "wincmd J"
漫漫岁月 2024-07-18 15:43:02

对于 IntelliJ IDEA(社区版)Windows 环境中的 3 路 git mergetool 配置(~/.gitconfig

Cygwin

[mergetool "ideamerge"]
     cmd = C:/Program\\ Files\\ \\(x86\\)/JetBrains/IntelliJ\\ IDEA\\ Community\\ Edition\\ 14.1.3/bin/idea.exe merge `cygpath -wa $LOCAL` `cygpath -wa $REMOTE` `cygpath -wa $BASE` `cygpath -wa $MERGED`
[merge]
     tool = ideamerge

Msys

[mergetool "ideamerge"]
cmd = "/c/Program\\ Files\\ \\(x86\\)/JetBrains/IntelliJ\\ IDEA\\ Community\\ Edition\\ 14.1.3/bin/idea.exe" merge `~/winpath.sh $LOCAL` `~/winpath.sh $REMOTE` `~/winpath.sh $BASE` `~/winpath.sh $MERGED`
[merge]
 tool = ideamerge

~/winpath。 sh 是在msys上将路径转换为Windows,取自stackoverflow上的msys路径转换问题

#! /bin/sh                                                               

function wpath {                                                         
    if [ -z "$1" ]; then                                                 
        echo "$@"                                                        
    else                                                                 
        if [ -f "$1" ]; then                                             
            local dir=$(dirname "$1")                                    
            local fn=$(basename "$1")                                    
            echo "$(cd "$dir"; echo "$(pwd -W)/$fn")" | sed 's|/|\\|g';  
        else                                                             
            if [ -d "$1" ]; then                                         
                echo "$(cd "$1"; pwd -W)" | sed 's|/|\\|g';              
            else                                                         
                echo "$1" | sed 's|^/\(.\)/|\1:\\|g; s|/|\\|g';          
            fi                                                           
        fi                                                               
    fi                                                                   
}                                                                        

wpath "$@" 

For IntelliJ IDEA (Community Edition) 3-way git mergetool configuration in Windows environment (~/.gitconfig)

Cygwin

[mergetool "ideamerge"]
     cmd = C:/Program\\ Files\\ \\(x86\\)/JetBrains/IntelliJ\\ IDEA\\ Community\\ Edition\\ 14.1.3/bin/idea.exe merge `cygpath -wa $LOCAL` `cygpath -wa $REMOTE` `cygpath -wa $BASE` `cygpath -wa $MERGED`
[merge]
     tool = ideamerge

Msys

[mergetool "ideamerge"]
cmd = "/c/Program\\ Files\\ \\(x86\\)/JetBrains/IntelliJ\\ IDEA\\ Community\\ Edition\\ 14.1.3/bin/idea.exe" merge `~/winpath.sh $LOCAL` `~/winpath.sh $REMOTE` `~/winpath.sh $BASE` `~/winpath.sh $MERGED`
[merge]
 tool = ideamerge

The ~/winpath.sh is to convert paths to Windows on msys and is taken from msys path conversion question on stackoverflow

#! /bin/sh                                                               

function wpath {                                                         
    if [ -z "$1" ]; then                                                 
        echo "$@"                                                        
    else                                                                 
        if [ -f "$1" ]; then                                             
            local dir=$(dirname "$1")                                    
            local fn=$(basename "$1")                                    
            echo "$(cd "$dir"; echo "$(pwd -W)/$fn")" | sed 's|/|\\|g';  
        else                                                             
            if [ -d "$1" ]; then                                         
                echo "$(cd "$1"; pwd -W)" | sed 's|/|\\|g';              
            else                                                         
                echo "$1" | sed 's|^/\(.\)/|\1:\\|g; s|/|\\|g';          
            fi                                                           
        fi                                                               
    fi                                                                   
}                                                                        

wpath "$@" 
风追烟花雨 2024-07-18 15:43:02

对于 kdiff3 你可以使用:

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

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

For kdiff3 you can use:

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

git config --global diff.guitool kdiff3
git config --global difftool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
git config --global difftool.kdiff3.trustExitCode false
小情绪 2024-07-18 15:43:02

要设置p4merge,在Windows上使用chocolatey安装用于合并和比较,请看这里:
https://gist.github.com/CamW/88e95ea8d9f0786d746a

To setup p4merge, installed using chocolatey on windows for both merge and diff, take a look here:
https://gist.github.com/CamW/88e95ea8d9f0786d746a

友欢 2024-07-18 15:43:02

如果您在从 SourceTree 打开 p4merge 时遇到问题,请在 MyRepo.git 下查找名为 config 的本地配置文件,并删除所有合并配置。
就我而言,它试图打开我刚刚卸载的 Meld

If you're having problems opening p4merge from SourceTree look for you local configuration file named config under MyRepo.git and delete any merge configuration.
In my case it was trying to open Meld which I just uninstalled

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文