“openssl”]不是有效的属性名称:.git / info / attributes:5

时间:2014-01-13 14:19:13

标签: git gitattributes

.git/info/attributes文件中设置属性时出现以下错误。

$ git add --dry-run . 
"openssl"] is not a valid attribute name: .git/info/attributes:5
"openssl"] is not a valid attribute name: .git/info/attributes:8
add '.gitignore'
add 'README.md'

档案内容:

* filter=openssl diff=openssl

[merge]
        renormalize=true
[filter "openssl"]
        smudge=~/.gitencrypt/smudge_filter_openssl
        clean=~/.gitencrypt/clear_filter_openssl
[diff   "openssl"]
        textconv=~/.gitencrpt/diff_filter_openssl

已更新:

$ git version
git version 1.8.3.2

1 个答案:

答案 0 :(得分:2)

对于其他用户,这是另一个原因,有人可能会得到一个 is not a valid attributes name .gitattributes:2错误消息。

冒号后的数字是.gitattributes文件中的违规行号。
特定修复的问题,
这是.gitattributes不理解的那一行,
即' xxx不是有效的属性名称。'

在我的回答中,信息中的第一个字符是'空格'
在海报的消息中,它是'" openssl"]'

错误消息:
is not a valid attribute name: .gitattributes:2

<强>原因:
  您正在设置属性值,     但是你在等号周围放置了空格。     只需删除空格!

<强> SOLUTION:
  代替:     .htaccess merge = ours   考虑:     .htaccess merge=ours

<强>症状:
  您添加一个新的gitattributes文件或行和      运行git status,和      收到此错误或类似错误:    不是有效的属性名称:.gitattributes:1

为什么你可能在你的文件中有这个:
  Git Book错误地发布了等号周围有空格的示例。  它应该没有。

<强>参考:
http://www.stegriff.co.uk/upblog/gitattributes-error-is-not-a-valid-attribute-name

这修复了我文件中的错误 显然海报的文件有不同的问题/解决方案 这是为其他用户添加的,以了解对类似错误消息的其他可能修复。