.gitconfig 错误
我编辑了 .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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
唔。您似乎在
driver
行上使用了智能引号(“
和”
),而不是直引号("
)这可能会导致一些问题。另一件事是检查是否存在 LF 和 CRLF 行结尾的混合,这可能会导致行数与十六进制编辑器中的行数不同。或将显示所有空白字符的编辑器,以查看是否有混合的行结尾。Hmm. You seem to have smart quotes (
“
and”
) on thedriver
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.A/ 我确认有问题的行是
B/ 引号不是问题(
“
或"
),尽管生成的命令将不起作用,除非您使用仅“
。但至少“
不会触发“无效的.gitconfig”错误消息。C/ 问题是
\
必须自行转义。会起作用的。
A/ I confirm the problematic line is
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.will work.
我看到一些可能存在问题的事情。其中之一是您在第 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
其他可能的问题是文件路径中包含空格。我会删除空格并用下划线或破折号替换它们。
Other possible problems are the file paths with spaces in them. I would remove the spaces and replace them with underscores or dashes.
我在第二行看到正斜杠 (/),在 LabVIEW Merge 行看到反斜杠 (\)。
也许罪魁祸首就是他们?
吨
I see forward slashes (/) on the second line and backward (\) on the LabVIEW Merge line.
Maybe they are the culprit?
Ton