2

I have configured my Git for Windows installation to use Beyond Compare (BC) for diffs and merges from the command line.

Unfortunately, when I'm working in Visual Studio 2022 and start a comparison for a file in the Git Changes tab, it starts BC to view the changes rather than just opening it in Visual Studio's built-in diff tool, which is not what I want.

If I go to the VS options I can select "Use Visual Studio" for diffs and merges, but this is changing my Git config so that, if I then do a git diff from the command line, it starts Visual Studio and loads the differences there for each file, rather than using Beyond Compare.

So, my question: [how] can I configure VS and/or Git to use VS diff when I'm in working in Visual Studio and my usual tool when I diff from the command line?

Rob Gilliam
  • 2,680
  • 4
  • 26
  • 29
  • 1
    You probably can't (configure that directly). Probably, the way to work around this is to add a level of indirection: write your own tiny program that inspects how it got called and, if you're in VS now, runs the thing that VS would have configured, had you asked VS to use VS. If you're not in VS now, have it run Beyond Compare, the way you would have run it directly before. – torek Oct 13 '22 at 17:43
  • That leaves you with the problem of figuring out how you got called, but it's very likely that there are environment variables that reliably tell you. – torek Oct 13 '22 at 17:44

0 Answers0