Using Visual Studio 2012's built-in merge tool with Git

后端 未结 3 1838
眼角桃花
眼角桃花 2020-12-07 11:48

So, I don\'t know if anyone\'s noticed but the new Merge Tool packaged with VS2012 is sick-o to the max. I\'ve recently moved to Git for my source control and really want to

3条回答
  •  眼角桃花
    2020-12-07 12:10

    This article explains how to do this. I tried this out and it works. In my usage, the diff was opened in any existing instance of Visual Studio, which is what you preferred.

    [diff]
        tool = vsdiffmerge
    [difftool]
          prompt = false
    [difftool "vsdiffmerge"]
          cmd = '"C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/vsdiffmerge.exe"' "$LOCAL" "$REMOTE" //t
          keepbackup = false
          trustexitcode = true
    [merge]
          tool = vsdiffmerge
    [mergetool]
          prompt = false
    [mergetool "vsdiffmerge"]
          cmd = '"C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/vsdiffmerge.exe"' "$REMOTE" "$LOCAL" "$BASE" "$MERGED" //m
          keepbackup = false
          trustexitcode = true
    

    Or use %VSINSTALLDIR% to always reference the version of Visual Studio that matches the commandline you have opened (this only works when the Visual Studio environment has been setup, either by using the Visual Studio Command Prompt shortcut or manually calling vsvars32.bat):

    [diff]
        tool = vsdiffmerge
    [difftool]
          prompt = false
    [difftool "vsdiffmerge"]
          cmd = '"%VSINSTALLDIR%Common7/IDE/vsdiffmerge.exe"' "$LOCAL" "$REMOTE" //t
          keepbackup = false
          trustexitcode = true
    [merge]
          tool = vsdiffmerge
    [mergetool]
          prompt = false
    [mergetool "vsdiffmerge"]
          cmd = '"%VSINSTALLDIR%Common7/IDE/vsdiffmerge.exe"' "$LOCAL" "$REMOTE" "$BASE" "$MERGED" //m
          keepbackup = false
          trustexitcode = true
    

提交回复
热议问题