English ▾
git-check-attr 手冊的本地化版本
主題 ▾
最新版本 ▾ git-check-attr 最後更新於 2.43.0
git-check-attr 手冊的變更
設定與配置
取得與建立專案
基本快照
分支與合併
分享與更新專案
檢查與比較
修補
除錯
電子郵件
外部系統
伺服器管理
指南
管理
底層命令
- 2.43.1 → 2.47.0 沒有變更
-
2.43.0
11/20/23
- 2.40.1 → 2.42.3 沒有變更
-
2.40.0
03/12/23
- 2.25.1 → 2.39.5 沒有變更
-
2.25.0
01/13/20
- 2.18.1 → 2.24.4 沒有變更
-
2.18.0
06/21/18
- 2.7.6 → 2.17.6 沒有變更
-
2.6.7
05/05/17
- 2.1.4 → 2.5.6 沒有變更
-
2.0.5
12/17/14
概要
git check-attr [--source <tree-ish>] [-a | --all | <attr>…] [--] <pathname>… git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>…]
輸出
輸出格式為:<路徑> COLON SP <屬性> COLON SP <資訊> LF
除非 -z
生效,在這種情況下,NUL 會被用作分隔符:<路徑> NUL <屬性> NUL <資訊> NUL
<路徑> 是正在查詢的檔案路徑,<屬性> 是正在查詢的屬性,而 <資訊> 可以是下列其中之一
緩衝處理的行為如同 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
GIT
屬於 git[1] 套件的一部分