views:

227

answers:

5
+1  Q: 

.gitconfig error

I edited my .gitconfig file to add support for LabView and it appears that I did something that Git doesn't exactly like. The problem is it (Git) doesn't tell me what it doesn't like. What did I do wrong?

The error message doesn't help much either: "fatal: bad config file line 13 in c:/Users/Tanner/.gitconfig"

[gui]
    recentrepo = C:/Users/Tanner/Desktop/FIRST 2010 Beta/Java/LoganRover

[user]
    name = Tanner Smith
    email = [email protected]

[merge "labview"]
    name = LabView 3-Way Merge
    driver =  “C:\Program Files\National Instruments\Shared\LabVIEW Merge\LVMerge.exe” “C:\Program Files\National Instruments\LabVIEW 8.6\LabVIEW.exe” %O %B %A %A
    recursive = binary

And I'm not seeing a line 13, but usually that would mean something is wrong at the end? I don't know, Git is new to me.

+1  A: 

I see a couple things that may be a problem. One of which is you are using curly quotes on line 10, and no quotes on line 2.

What editor did you edit this with? Please use a plain text editor like notepad or vim.

Lastly: use git-config to edit this file, rather than by hand. See the following link:

http://www.kernel.org/pub/software/scm/git/docs/git-config.html

gahooa
This is all good advice too, though sometimes it is easier to edit this in a text editor than through `git-config`.
Brian Campbell
+1  A: 

Hmm. You seem to have smart quotes ( and ) on the driver line instead of straight quotes ("). That might cause some problems. Another thing to check is to see if there is a mix of LF and CRLF line endings; that might make the line count be different than what it looks like. Try looking at your file in a hex editor, or an editor that will display all whitespace characters, to see if you have a mix of line endings.

Brian Campbell
A: 

Other possible problems are the file paths with spaces in them. I would remove the spaces and replace them with underscores or dashes.

allesklar
A: 

A/ I confirm the problematic line is

    driver =  “C:\Program Files\National Instruments\Shared\LabVIEW Merge\LVMerge.exe” “C:\Program Files\National Instruments\LabVIEW 8.6\LabVIEW.exe” %O %B %A %A

B/ The quotes are not the issue ( or "), although the resulting command will not work unless you are using " only. But at least does not trigger the "invalid .gitconfig" error message.

C/ The problem is the \ which have to be escaped themselves.

    driver =  “C:\\Program Files\\National Instruments\\Shared\\LabVIEW Merge\\LVMerge.exe” “C:\\Program Files\\National Instruments\\LabVIEW 8.6\\LabVIEW.exe” %O %B %A %A

will work.

VonC
That fixed the config problem, though when it needs to merge it complains:sh: C:Program: command not founderror: cannot run sh: No such file or directoryfatal: Failed to execute internal merge
Tanner
A: 

I see forward slashes (/) on the second line and backward (\) on the LabVIEW Merge line.
Maybe they are the culprit?

Ton

Ton