1

I am getting an error saying that

fatal bad config file line 24 in .git/config

Here is what I have in my config file..

[mergetool "winmerge"]
        name = WinMerge
        trustExitCode = true
        cmd = "C:\Program Files (x86)\WinMerge\WinMergeU.exe" -u -e -dl \"Local\" dr \"Remote\" $LOCAL $REMOTE $MERGED

line 24 is the line starting with "cmd = "...

Can anyone tell me what I am doing wrong here?

I tried to follow this

psj01
  • 3,075
  • 6
  • 32
  • 63

1 Answers1

1

Try with '/' instad of \:

cmd = "C:/Program Files (x86)/WinMerge/WinMergeU.exe" -u -e -dl \"Local\" dr \"Remote\" $LOCAL $REMOTE $MERGED

Note that, as I noted before (details here), since git 2.5+, a simpler config shoud be enough:

git config diff.tool winmerge

git itself knows about the right mergetool.cmd syntax to use with winmerge.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I tried that but now its giving me a new error saying that merge.tool is not configured. . ... No known merge tool is available. – psj01 Jun 11 '16 at 05:13
  • @psj01 What is the version of your git? Also, if you try that (ie. just `git config diff.tool winmerge`), you need to edit your config first and remove the all `mergetool "winmerge"` section. – VonC Jun 11 '16 at 05:18
  • git version is version 1.9.5.msysgit.1 i did remove all that stuff.. before i did git config diff.tool winmerge.. – psj01 Jun 11 '16 at 05:27
  • @psj01 simply unzip https://github.com/git-for-windows/git/releases/download/v2.8.4.windows.1/PortableGit-2.8.4-64-bit.7z.exe anywhere you want (no setup or installation required), add it to your %PATH% and try again. git 2.8.4 is more than 2.5. 1.9.5 is not. – VonC Jun 11 '16 at 05:28
  • @psj01 in your CMD session, type `set PATH=C:\path\to\git2.8.4\bin;%PATH%`. Check with `git --version`. Then try again the git config (after cleaning up your local config which is in `.git/config`) – VonC Jun 11 '16 at 05:34
  • when i type in set PATH=C:\path\to\git2.8.4\bin;%PATH% I get error saying sh.exe":fg: %PATH%: no such job – psj01 Jun 11 '16 at 05:43
  • 1
    @psj01 No need for a bash here. Try it in a regular CMD session (Type the Windows key+R, then cmd) – VonC Jun 11 '16 at 05:44