Сконфигурируйте Git для использования Beyond Compare для сравнения изображений

3486
Barney

Поскольку мы работаем с несколькими спрайтами, вид специальных представлений diff, предоставляемых Beyond Compare, был бы идеальным, чтобы увидеть, какая из двух версий мне нужна, когда возникают конфликты.

Я уже настроен Git использовать Beyond Compare, как мое основное сравнение и слияние инструмента, как описано в их интеграции руководстве - это конкретно идет в том, как настроить TortoiseSVN, чтобы использовать его для изображений, и я нашел эти статьи говорят о том, .gitattributesв общем и как создавать сценарии взаимодействия из оболочки * nix - но для меня не очевидно, как я могу использовать рекомендации, приведенные в этих руководствах, для внесения простого изменения, которое скажет: «использовать привязки diff и merge по умолчанию для файлов, которые также определены как изображения» ».

Для записи, я делаю все это на Windows: P

4

1 ответ на вопрос

4
Cristian Ciupitu

From Using Beyond Compare with Version Control Systems - Git for Windows:

Note: If you use the Git for Windows' Bash Command Prompt instead of the default Windows Command Prompt, you need to escape the $ character with .

For Git 1.7.6 and newer, edit the global config file to set the path

Diff

At a Windows command prompt enter the commands:

git config --global diff.tool bc3 git config --global difftool.bc3.path "c:/program files/beyond compare 3/bcomp.exe" 

To launch a diff with BC3, use the command "git difftool foofile.txt".

3-way Merge (v3 Pro)

At a Windows command prompt, enter the commands:

git config --global merge.tool bc3 git config --global mergetool.bc3.path "c:/program files/beyond compare 3/bcomp.exe" 

Use git merge for the regular merge and git mergetool for the Beyond Compared based merge.

This worked fine with BCompare-3.3.8.16340.exe and Git-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]: