-3

I have read all related answers but still unable to launch beyond compare 4 from my git bash 2.37.1 I have followed standard instruction from beyond compare website as well but its not helping, whenever i try to launch difftool it just return without launching bc ...any idea ?

https://www.scootersoftware.com/support.php?zz=kb_vcs As per beyond compare instructions

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

Global config file looks like this

[diff]
    tool = bc
[difftool "bc"]
    path = c:/Program Files/Beyond Compare 4/bcomp.exe
User
  • 619
  • 1
  • 9
  • 24
  • 3
    No pictures of code please. – matt Jul 31 '22 at 12:31
  • @matt, whats wrong even if its a picture. Just did that to make sure i didnt miss anything. Comment would have been appreciated for the constructive criticism, as i ve never posted any code picture, except this one! – User Jul 31 '22 at 13:02
  • 2
    [Why I should not upload images of code/data/errors when asking a question...](//meta.stackoverflow.com/q/285551) – matt Jul 31 '22 at 13:09
  • Okay, if community guidlines say so and it helps, i am going to replace images with code. – User Jul 31 '22 at 13:37
  • I don't know Windows, but I find it interesting that the path in your global config file is not the same as the path that you gave in your `git config --global` command. Could that be relevant? – matt Jul 31 '22 at 13:52
  • No, thats not, actually was some typo error by me. I have tried even with VS code, editing launch is working fine but difftool command is not able to launch the file differences even with VS code. – User Jul 31 '22 at 14:05
  • 2
    See, the idea of asking a question on Stack Overflow is that you don't have any "typo error" because you _copy and paste the actual code_. – matt Jul 31 '22 at 14:12
  • Got the answer, configuration was fine and reason is this: `git difftool` without additional arguments will display the diff between what is staged and your files on disk ; if all of your changes are staged (using the `git added`), then nothing is displayed. I am a biginner in git, so didnt know that, you can check it using `git status -s` command, if there is green M difftool wont be launched, if red then yes because here are some differences to show. – User Jul 31 '22 at 14:51
  • 2
    Yup, so since this was trivially solved by some thing that didn't even appear in the question (you never showed your diff command or explained the situation), please delete the question. – matt Jul 31 '22 at 15:19
  • @matt yes, i did mention difftool command already you can read question text once again, and put a pic of that which i deleted later, as its not recommended. and if i knew everything already, then i wouldnt have posted the question here. I would like to keep my question and answer here as some Git beginner like me might be wondering why its not working, when everything in the config looks fine. I am open for the extra knowldege, if you have something technical to add...please go ahead. – User Jul 31 '22 at 21:50

1 Answers1

0

So basically if you have tried everything and you are pretty sure that your global config file and PATH on the windows machine also looks good. then try following as given below, as it may be just a beginner mistake like me, you also might dont know that simple difftool command only shows the file differences between the working directory on your disc and the staged version. If everything is already staged then difftool wont be launched as there are no differences to show.

$ echo test_staged >file_test.txt # File modified
$ git add file_test.txt           # Modified file got staged
$ git difftool file_test.txt      # No difference as changes are staged, use file_test.txt if you multiple files in the folder
 or
 $ git difftool                   # if file_test.txt is the only file in the folder

$ echo test_local_copy_without_staged > file_test.txt  # Text file unstaged on your local disc

$ git difftool   # Now you can see the difference between staged and local disc copy

warning: in the working copy of 'file_test.txt', LF will be replaced by CRLF the next time Git touches it

Viewing (1/1): 'file_test.txt'
Launch 'bc' [Y/n]? Y

and yes thats it, now you should see the differences in your beyond compare tool !

User
  • 619
  • 1
  • 9
  • 24