Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why vsdiffmerge alway open a new VisualStudio and not show the diff

I want to use vsdiffmerge as git diff tool. And I set the .git/config below.

[diff]
    tool = vsdiffmerge
[difftool]
      prompt = true
[difftool "vsdiffmerge"]
      cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\vsDiffMerge.exe\" \"$LOCAL\" \"$REMOTE\" //t
      keepbackup = false
      trustexistcode = true
[merge]
      tool = vsdiffmerge
[mergetool]
      prompt = true
[mergetool "vsdiffmerge"]
      cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\vsDiffMerge.exe\" \"$LOCAL\" \"$REMOTE\" //t //m
      keepbackup = false
      trustexistcode = true

I find it can work well some times but it will open a new VisualStudio and not show the diff tab. I try delete the //t but not help.

I want to ask two question:

  1. How to make the vsdiffmerge open the diff tab in the opening VisualStudio?

  2. How to use git diff multi-file once that I dont want to input all file to y. I see the number of files is 133 that I should press 133 y.

like image 803
lindexi Avatar asked Nov 09 '17 02:11

lindexi


1 Answers

The commands for difftool and mergetool should be a little different:

Try this:

  • Difftool Command: /t "$LOCAL" "$REMOTE"

  • MergeTool Command: /m /t "$LOCAL" "$REMOTE" "$BASE" "$MERGED"

Here is an example for Visual Studio 2019 but it should be similar for Visual Studion 2017:

difftool.vsdiffmerge.path=C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/vsDiffMerge.exe
difftool.vsdiffmerge.cmd=/t "$LOCAL" "$REMOTE"
mergetool.vsdiffmerge.path=C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/vsDiffMerge.exe
mergetool.vsdiffmerge.cmd=/m /t "$LOCAL" "$REMOTE" "$BASE" "$MERGED"

I use/lunch this from from GitExtensions but it should be very similar from other git Client apps.

like image 149
xargs Avatar answered Nov 02 '22 03:11

xargs