配置 Git 以使用 Beyond Compare 进行图像差异

Bar*_*ney 5 windows version-control git images beyondcompare

因为我们使用许多精灵,所以Beyond Compare提供的那种专门的差异视图非常适合在出现冲突时查看我在使用两个版本中的哪一个。

\n\n

我已经将 Git 配置为使用 Beyond Compare 作为我的主要差异和合并工具,如其集成指南 \xe2\x80\x94 中所述,它专门介绍了如何配置 TortoiseSVN 以将其用于图像,并且我发现这些 文章一般讨论.gitattributes如何从 *nix shell \xe2\x80\x94 编写交互脚本,但对我来说,如何使用这些指南提供的建议来进行简单的更改并不明显,即“对于确定为图像的文件也使用默认的差异和合并绑定”。

\n\n

郑重声明,我是在 Windows 上完成这一切的:P

\n

Cri*_*itu 5

来自使用 Beyond Compare 与版本控制系统 - Git for Windows

注意:如果您使用 Git for Windows 的 Bash 命令提示符而不是默认的 Windows 命令提示符,则需要使用 转义 $ 字符。

对于 Git 1.7.6 及更高版本,编辑全局配置文件以设置路径

差异

在 Windows 命令提示符处输入命令:

git config --global diff.tool bc3
git config --global difftool.bc3.path "c:/program files/beyond compare 3/bcomp.exe"
Run Code Online (Sandbox Code Playgroud)

要使用 BC3 启动 diff,请使用命令“git difftool foofile.txt”。

3 路合并 (v3 Pro)

在 Windows 命令提示符下,输入命令:

git config --global merge.tool bc3
git config --global mergetool.bc3.path "c:/program files/beyond compare 3/bcomp.exe"
Run Code Online (Sandbox Code Playgroud)

用于git merge常规合并和git mergetool基于超越比较的合并。

这与BCompare-3.3.8.16340.exeGit-1.8.4-preview20130916.exe配合得很好:

C:\su-q>git difftool "HEAD^"

Viewing: 'README'
Launch 'bc3' [Y/n]:

Viewing: 'bag_frame.gif'
Launch 'bc3' [Y/n]:
Run Code Online (Sandbox Code Playgroud)