简体   繁体   中英

How do I configure Araxis Merge for use with Visual Studio Git?

I have to use Git with Visual Studio 2017 now, and there doesn't seem to be a way to link Araxis Merge with Visual Studio / Git.

This explains how to link Visual Studio TFS with Araxis.

This explains how to link Git with Araxis.

But how to link Visual Studio 2017 Plug-in Selection (with Git) to Araxis?

在此处输入图片说明

If you're running Visual Studio 2019 Enterprise (as I am--this might work for other versions of Visual Studio that use built-in Git for source control):

  1. Navigate to the folder that contains the global .gitconfig file, which is at: %HOMEDRIVE%%HOMEPATH% (your user folder).
  2. Find .gitconfig there and edit it with Notepad.exe, or some other text editor.

You're going to be looking for four key sections: [diff] , [difftool] , [merge] , and [mergetool] .

  • [diff] : Tells Visual Studio Git which diff tool to launch when you compare one version of a file with another.
  • [difftool] : Specifies the name of the diff tool as well as the commandline to execute to launch that tool.
  • [merge] : Tells Visual Studio Git which merge tool to launch when you merge one file with another.
  • [mergetool] : Specifies the name of the merge tool as well as the commandline to execute to launch that tool.

I suggest removing your existing [diff] , [difftool] , [merge] , and [mergetool] sections and replacing them so that your gitconfig file looks something like this:

[user]
    name = <your name>
    email = <your email address>
[diff]
    tool = araxisdiff
[difftool "araxisdiff"]
    cmd = \"C:\\Program Files\\Araxis\\Araxis Merge\\Merge.exe\" \"$LOCAL\" \"$REMOTE\"
[merge]
    tool = araxismerge
[mergetool "araxismerge"]
    cmd = \"C:\\Program Files\\Araxis\\Araxis Merge\\Merge.exe\" \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"
[difftool "vsdiffmerge"]
    cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" //t
    keepBackup = false

What's going on is rather straightforward: The [diff] section specifies which of the [difftool] entries will be used for file compares; the [merge] section specifies which of the [mergetool] entries will be used for file merges. In the above case, I specified araxisdiff as my diff tool and araxismerge as my merge tool. If I wanted to use the built-in Visual Studio diff/merge tool, I could change the tool = statement for each so that it specifies vsdiffmerge instead.

In the current source control plug-in drop-down, select Visual Studio Team Foundation. 源代码管理插件下拉菜单

You can follow the link that you mentioned in the question to setup araxis.

If you still can't, it's because your source is being controlled by Git instread for Team Foundation. You need to update git config use araxis as diff and merge too. You can find your git config file in ur repo under ' .git/config '.

Sample below.

 [diff] tool = araxis [merge] tool = araxis [mergetool "araxis"] path = C:/Program Files/Araxis/Araxis Merge/Compare.exe [difftool "araxis"] path = C:/Program Files/Araxis/Araxis Merge/Compare.exe

In Visual Studio 2019 you need to edit at minimum your global .gitconfig and if needed the local to the project/solution .gitconfig.

Also my latest version of of araxis installed itself into a location other than Program Files but in appdata. Uggg


Here is what I had to use in both configs:

[diff]
tool = araxis
[difftool "araxis"]
path = C:\\Users\\{my UserName}\\AppData\\Local\\Apps\\Araxis\\Araxis Merge\\compare.exe

[merge]
tool = araxis
[mergetool "araxis"]
path = C:\\Users\\{my UserName}\\AppData\\Local\\Apps\\Araxis\\Araxis Merge\\compare.exe

If it works then you see a grayed out araxis and the Use Visual Studio is selectable which at first glance is counter intuitive (IMHO).

This is what you see in config:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM