Announcement

Collapse
No announcement yet.

Git error when trying to diff with Beyond Compare 4

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

  • Git error when trying to diff with Beyond Compare 4

    Hi Mr. or Mrs,

    Today, I install the Beyond compare tool for windows, and I follow the installation notes for Git (My Git version is: 1.9.4)
    When I am trying to do a “git difftool file” command it gives me the following error message:

    c:\Users\<<UserName>>\AppData\Local\GitHub\Portabl eGit_7eaa994416ae7b397b2628033ac45f8ff6ac2010\libe xec\git-core\mergetools\bc3 line 121 c:/program files (x86)/beyond compare 3/bcomp.exe: No such file or directory

    The contents of the above file looks like this:

    diff_cmd () {
    "$merge_tool_path" "$LOCAL" "$REMOTE"
    }

    merge_cmd () {
    touch "$BACKUP"
    if $base_present
    then
    "$merge_tool_path" "$LOCAL" "$REMOTE" "$BASE" \
    -mergeoutput="$MERGED"
    else
    "$merge_tool_path" "$LOCAL" "$REMOTE" \
    -mergeoutput="$MERGED"
    fi
    check_unchanged
    }

    translate_merge_tool_path() {
    if type bcomp >/dev/null 2>/dev/null
    then
    echo bcomp
    else
    echo bcompare
    fi
    }


    My .gitConfig file looks like this:

    [diff]
    tool = bc3
    [difftool "bc3"]
    path = c:/Program Files (x86)/Beyond Compare 4/bcomp.exe
    [merge]
    tool = bc3
    [mergetool "bc3"]
    path = c:/Program Files (x86)/Beyond Compare 4/bcomp.exe

    Can I get the beyond compare tool to do a diff with Git?

    Thank you,
    E.

  • #2
    Hello,

    Git changes how it handles the configuration pretty wildly between its versions. I verified our directions do work on the latest Git for Windows release 2.1.2. Is updating to a newer version of Git an option?
    http://www.scootersoftware.com/suppo...vcs#gitwindows
    Aaron P Scooter Software

    Comment


    • #3
      I have installed github for windows, but I mainly use the command line. Github for windows installs Git Shell. This is what I mainly use, and its version is a par with the latest git shell 1.9.4
      My GitHub for Windows version is 2.4.1.2

      Thanks,
      E.

      Comment


      • #4
        The Git for Windows instructions that Aaron linked to earlier work with the current version of Git for Windows, which displays the version as 1.9.4.msysgit.2 when you run "git --version" at the command line.

        The version of Git bundled with GitHub for Windows uses a different configuration than Git for Windows, so the instructions on our page will not work with it. I'm researching configuration instructions for GitHub for Windows. I'll make a followup post if I find a solution.
        Chris K Scooter Software

        Comment


        • #5
          Here are terminal commands to configure Beyond Compare 4 Pro for Windows as the diff and merge tool for GitHub 2.4.1.2 for Windows:

          Diff:
          git config --global diff.tool bc4
          git config --global difftool.bc4.cmd "\"c:/program files (x86)/beyond compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\""


          Merge:
          git config --global merge.tool bc4
          git config --global mergetool.bc4.cmd "\"c:/program files (x86)/beyond compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""
          git config --global mergetool.bc4.trustExitCode true


          To launch a diff in Beyond Compare use the command:
          git difftool file.ext

          To launch a merge in Beyond Compare, use the command:
          git mergetool file.ext
          Chris K Scooter Software

          Comment


          • #6
            The Git for Windows instructions on our website are updated with instructions valid for both Git for Windows from the official Git website and the version of Git included with GitHub for Windows.

            Beyond Compare as Diff and Merge tool in Git for Windows:
            http://www.scootersoftware.com/suppo...vcs#gitwindows
            Chris K Scooter Software

            Comment


            • #7
              Originally posted by Chris View Post
              The Git for Windows instructions on our website are updated with instructions valid for both Git for Windows from the official Git website and the version of Git included with GitHub for Windows.

              Beyond Compare as Diff and Merge tool in Git for Windows:
              http://www.scootersoftware.com/suppo...vcs#gitwindows
              These settings are not working for me. When I run the mergetool it doesn't load any files into the app for merging.

              Comment


              • #8
                Hello,

                Which version of Git are you running, on which OS?

                If you follow the instructions for "bc3", including using "bc3" text, but give the path to Beyond Compare 4, does this work for you?
                Aaron P Scooter Software

                Comment


                • #9
                  Hi Aaron,

                  git version 1.9.4.msysgit.2
                  Windows 8.1 Enterprise

                  I'll try out the bc3 instructions. I think I tried these, but will verify with the "bc3" text instructions as you suggested.

                  Thanks,
                  Jeff

                  Originally posted by Aaron View Post
                  Hello,

                  Which version of Git are you running, on which OS?

                  If you follow the instructions for "bc3", including using "bc3" text, but give the path to Beyond Compare 4, does this work for you?

                  Comment


                  • #10
                    Thanks. "bc3" is a keyword that Git recognizes and then can properly call bcomp.exe as a difftool. It does not appear that "bc4" support has been added, but since we haven't changed our command line from BC3 to BC4, I found this worked for the latest release.
                    Aaron P Scooter Software

                    Comment


                    • #11
                      This worked great once I realized I needed to change the path to the bc4 path <forehead slap>. Thanks for your help, Aaron!

                      Originally posted by Aaron View Post
                      Thanks. "bc3" is a keyword that Git recognizes and then can properly call bcomp.exe as a difftool. It does not appear that "bc4" support has been added, but since we haven't changed our command line from BC3 to BC4, I found this worked for the latest release.

                      Comment


                      • #12
                        Git instructions on site indicated the following commands under Git for Windows Diff and 3-way Merge:
                        git config --global difftool.bc3.path "c:/Program Files (x86)/Beyond Compare 4/bcomp.exe"
                        git config --global mergetool.bc3.path "c:/Program Files (x86)/Beyond Compare 4/bcomp.exe"

                        I changed these commands to:
                        git config --global difftool.bc3.path "c:/Program Files/Beyond Compare 4/bcomp.exe"
                        git config --global mergetool.bc3.path "c:/Program Files/Beyond Compare 4/bcomp.exe"

                        Diff & 3-way Merge worked fine after the change.
                        BComp.exe was not in C:/Program Files (x86), it was in C:\Program Files.

                        Comment


                        • #13
                          Hello,

                          BC4.1 added 64bit support. The 32bit install is located in x86, and if that version is updated to 64bit it remains in the same directory, similar to other programs which update in place without requiring an Uninstall.

                          If 4.0 is uninstalled first, or a fresh 4.1 install, it will place the 64bit version in Program Files\.
                          Aaron P Scooter Software

                          Comment


                          • #14
                            Old thread, but in case someone stumbles across it in Google like me, I had to escape the $LOCAL/$REMOTE variables to stop them coming up blank (resulting in no files being loaded by BC4):

                            Wrong:
                            git config --global mergetool.bc4.cmd ""c:/program files/beyond compare 4/bcomp.exe" "$LOCAL" "$REMOTE" "$BASE" "$MERGED""
                            $ git config --global mergetool.bc4.cmd
                            "c:/program files/beyond compare 4/bcomp.exe" "" "" "" ""

                            Right:
                            $ git config --global mergetool.bc4.cmd ""c:/program files/beyond compare 4/bcomp.exe" "\$LOCAL" "\$REMOTE" "\$BASE" "\$MERGED""
                            $ git config --global mergetool.bc4.cmd
                            "c:/program files/beyond compare 4/bcomp.exe" "$LOCAL" "$REMOTE" "$BASE" "$MERGED"

                            Comment


                            • #15
                              For people with fresh recent (2017) installs of BC4 and Git on Windows (64-bit BC4, no 32-bit BC4, Windows Git 2.10.0+) instructions listed here in the site work fine for me with one big caveat: I had to run them from a directory other than my git project directory (wasted a lot of time unfortunately cleaning the config files retrying etc.); run these from another place such as your home directory (wherever you don't have a git project),

                              git config --global diff.tool bc
                              git config --global difftool.bc.path "c:/Program Files/Beyond Compare 4/bcomp.exe"

                              git config --global merge.tool bc
                              git config --global mergetool.bc.path "c:/Program Files/Beyond Compare 4/bcomp.exe"

                              Comment

                              Working...
                              X