Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"openssl"] is not a valid attribute name: .git/info/attributes:5

I am getting following error when setting attributes in .git/info/attributes file.

$ 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'

Content of file:

* 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

Updated:

$ git version
git version 1.8.3.2
like image 975
twid Avatar asked Oct 02 '22 21:10

twid


1 Answers

For other users, here is another reason wy someone might get a
is not a valid attributes name .gitattributes:2 error message.

The number after the colon is the offending line number in your .gitattributes file.
regardelss fo the specific fix,
this is the line that .gitattributes does not understand,
ie 'xxx is not a valid attribute name..'

In my answer the first character in the message is a 'space'
In the poster's message it was '"openssl"]'

ERROR MESSAGE:
is not a valid attribute name: .gitattributes:2

CAUSE:
You're setting an attribute value, but you've put spaces around the equals sign. Just remove the spaces!

SOLUTION:
Instead of: .htaccess merge = ours Consider: .htaccess merge=ours

SYMPTOM:
You add a new gitattributes file or line and run git status, and receive this error or similar: is not a valid attribute name: .gitattributes:1

WHY YOU MAY HAVE THIS IN YOUR FILE:
Git Book incorrectly published examples with spaces around the equals sign. It should not have.

REFERENCE:
http://www.stegriff.co.uk/upblog/gitattributes-error-is-not-a-valid-attribute-name

This fixed the error in my file.
Obviously the poster's file had a different problem/solution
This is added for other users to know about other possible fixes to a similar error message.

like image 195
SherylHohman Avatar answered Oct 12 '22 18:10

SherylHohman