.gitconfig 错误

发布于 2024-08-16 13:41:05 字数 748 浏览 7 评论 0原文

我编辑了 .gitconfig 文件以添加对 LabView 的支持,但似乎我做了一些 Git 不完全喜欢的事情。问题是它(Git)没有告诉我它不喜欢什么。我做错了什么?

错误消息也没有多大帮助: “致命:c:/Users/Tanner/.gitconfig 中的错误配置文件第 13 行”

[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

我没有看到第 13 行,但这通常意味着最后出现了问题?我不知道,Git 对我来说很陌生。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

猫弦 2024-08-23 13:41:05

唔。您似乎在 driver 行上使用了智能引号(),而不是直引号(")这可能会导致一些问题。另一件事是检查是否存在 LF 和 CRLF 行结尾的混合,这可能会导致行数与十六进制编辑器中的行数不同。或将显示所有空白字符的编辑器,以查看是否有混合的行结尾。

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.

情未る 2024-08-23 13:41:05

A/ 我确认有问题的行是

    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/ 引号不是问题("),尽管生成的命令将不起作用,除非您使用 仅“。但至少不会触发“无效的.gitconfig”错误消息。

C/ 问题是 \ 必须自行转义。

    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

会起作用的。

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.

呆萌少年 2024-08-23 13:41:05

我看到一些可能存在问题的事情。其中之一是您在第 10 行使用了大引号,而在第 2 行没有使用引号。

您使用什么编辑器编辑此内容?请使用纯文本编辑器,如记事本或 vim。

最后:使用 git-config 来编辑此文件,而不是手动编辑。请参阅以下链接:

http://git-scm.com/docs/git-config

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://git-scm.com/docs/git-config

奢华的一滴泪 2024-08-23 13:41:05

其他可能的问题是文件路径中包含空格。我会删除空格并用下划线或破折号替换它们。

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

梦明 2024-08-23 13:41:05

我在第二行看到正斜杠 (/),在 LabVIEW Merge 行看到反斜杠 (\)。
也许罪魁祸首就是他们?

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

Ton

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文