簡體中文 ▾
主題 ▾
最新版本 ▾ git-check-attr 最後更新於 2.50.0
git-check-attr 手冊中的更改
設定和配置
獲取和建立專案
基本快照
分支與合併
共享和更新專案
檢查和比較
打補丁
除錯
電子郵件
外部系統
伺服器管理
指南
管理
底層命令
- 2.50.1 無更改
-
2.50.0
2025-06-16
- 2.43.1 → 2.49.1 無更改
-
2.43.0
2023-11-20
- 2.40.1 → 2.42.4 無更改
-
2.40.0
2023-03-12
- 2.25.1 → 2.39.5 無更改
-
2.25.0
2020-01-13
- 2.18.1 → 2.24.4 無更改
-
2.18.0
2018-06-21
- 2.7.6 → 2.17.6 無更改
-
2.6.7
2017-05-05
- 2.1.4 → 2.5.6 無更改
-
2.0.5
2014-12-17
概要
git check-attr [--source <tree-ish>] [-a | --all | <attr>…] [--] <pathname>… git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>…]
輸出
輸出格式為:<path> COLON SP <attribute> COLON SP <info> LF
除非 -z
生效,在這種情況下,NUL 用作分隔符:<path> NUL <attribute> NUL <info> NUL
<path> 是正在查詢的檔案的路徑,<attribute> 是正在查詢的屬性,而 <info> 可以是以下之一:
緩衝按照 git[1] 中 GIT_FLUSH
選項的文件進行。呼叫者有責任避免因輸入緩衝區溢位或從空輸出緩衝區讀取而導致的死鎖。
示例
在示例中,使用以下 .gitattributes 檔案
*.java diff=java -crlf myAttr NoMyAttr.java !myAttr README caveat=unspecified
-
列出單個屬性
$ git check-attr diff org/example/MyClass.java org/example/MyClass.java: diff: java
-
列出檔案的多個屬性
$ git check-attr crlf diff myAttr -- org/example/MyClass.java org/example/MyClass.java: crlf: unset org/example/MyClass.java: diff: java org/example/MyClass.java: myAttr: set
-
列出檔案的所有屬性
$ git check-attr --all -- org/example/MyClass.java org/example/MyClass.java: diff: java org/example/MyClass.java: myAttr: set
-
列出多個檔案的屬性
$ git check-attr myAttr -- org/example/MyClass.java org/example/NoMyAttr.java org/example/MyClass.java: myAttr: set org/example/NoMyAttr.java: myAttr: unspecified
-
並非所有值都同樣明確
$ git check-attr caveat README README: caveat: unspecified