Announcement

Collapse
No announcement yet.

How to configure BC4 for use with git in Visual Studio Code (VSCode)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to configure BC4 for use with git in Visual Studio Code (VSCode)

    My .gitconfigure file includes the following:
    Code:
    [merge]
    	tool = C:\\Program Files\\Beyond Compare 4\\Bcompare.exe
    [diff]
    	tool = bc
    [difftool "bc"]
    	path = C:\\Program Files\\Beyond Compare 4\\Bcompare.exe
    I've tried a couple of VSCode extensions* , but none will launch BC. Any suggestions?

    * Run git difftool and GitDiffer

  • #2
    Hello,

    How are you launching the diff from VSCode?

    Looking around, it looks like VSCode supports an internal diff tool, but not an external one:
    https://code.visualstudio.com/docs/e...versioncontrol
    I found this thread that points to 3rd party tools that add the functionality, but not 1st party:
    https://stackoverflow.com/questions/...pare-diff-tool

    As for the above, you'll want to edit the .gitconfig slightly:
    http://www.scootersoftware.com/suppo...vcs#gitwindows

    The paths should be to "bcomp.exe" instead of "bcompare.exe", and you'll need to add a mergetool "bc" section.
    Code:
    [diff]
    	tool = bc
    [difftool "bc"]
    	path = C:/Program Files/Beyond Compare 4/BComp.exe
    [merge]
    	tool = bc
    [mergetool "bc"]
    	path = c:/Program Files/Beyond Compare 4/BComp.exe
    With this configured, you should be able to launch the Git Bash, and use "git difftool" on the Git for Windows command line.
    Aaron P Scooter Software

    Comment


    • #3
      I was trying to launch using a right-click. With your gitconfig suggestions, it now works when I install the VSCode extension GitDiffer. thanks!

      Comment


      • #4
        Originally posted by Aaron View Post
        Hello,

        How are you launching the diff from VSCode?

        Looking around, it looks like VSCode supports an internal diff tool, but not an external one:
        https://code.visualstudio.com/docs/e...versioncontrol
        I found this thread that points to 3rd party tools that add the functionality, but not 1st party:
        https://stackoverflow.com/questions/...pare-diff-tool

        As for the above, you'll want to edit the .gitconfig slightly:
        http://www.scootersoftware.com/suppo...vcs#gitwindows

        The paths should be to "bcomp.exe" instead of "bcompare.exe", and you'll need to add a mergetool "bc" section.
        Code:
        [diff]
        tool = bc
        [difftool "bc"]
        path = C:/Program Files/Beyond Compare 4/BComp.exe
        [merge]
        tool = bc
        [mergetool "bc"]
        path = c:/Program Files/Beyond Compare 4/BComp.exe
        With this configured, you should be able to launch the Git Bash, and use "git difftool" on the Git for Windows command line.
        I'm using Visual Studio Professional 2019 with no 3rd party Git stuff; just the built in functionality. Nothing here or anywhere else I looked worked. Eventually I figured out that the "cmd" field is what Visual studio is triggering inside the IDE. So after adding this "cmd" line it worked (the "path" is for when using Gitbash)

        [difftool "bc"]
        path = "c:\\Program Files\\Beyond Compare 4\\bcompare.exe"
        cmd = "C:\\Program Files\\Beyond Compare 4\\bcompare.exe" "$LOCAL" "$REMOTE"

        Comment


        • #5
          Hello,

          Besides the links in this thread, did you give the Microsoft Git Provider plug-in a try? http://www.scootersoftware.com/suppo...sualstudio-git

          It's great that this CMD configuration also worked for you. BC4's command line is fairly generic, so as long as the tool has a method of defining external difftool support, BC4 can plug into it with the different methods they provide.
          Aaron P Scooter Software

          Comment

          Working...
          X