5

ファイルに属性を設定すると、次のエラーが発生し.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
4

1 に答える 1

4


is not a valid attributes name .gitattributes:2他のユーザーの場合、エラー メッセージが表示 される別の理由を次に示します。

コロンの後の数字は、.gitattributes ファイル内の問題のある行番号です。
特定の修正に関して、
これは .gitattributes が理解できない行です
。つまり、「xxx は有効な属性名ではありません..」

私の答えでは、メッセージの最初の文字は「スペース」です
。ポスターのメッセージでは、「openssl」] でした。

エラーメッセージ:
is not a valid attribute name: .gitattributes:2

原因:
属性値を設定していますが、等号の前後にスペースを入れています。スペースを削除するだけです!

解決策:
代わりに: .htaccess merge = ours 考慮してください: .htaccess merge=ours

症状:
新しい gitattributes ファイルまたは行を追加して git status を実行すると、次のエラーまたは類似のエラーが表示されます: is not a valid attribute name: .gitattributes:1

ファイルにこれが含まれている理由:
Git Bookは、等号の前後にスペースを含む例を誤って公開しました。あるべきではありません。

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

これにより、ファイルのエラーが修正されました。
明らかに、投稿者のファイルには別の問題/解決策
がありました。これは、他のユーザーが同様のエラー メッセージに対する他の可能な修正について知るために追加されています。

于 2016-07-19T18:11:16.053 に答える