English ▾
git-check-attr 手册的本地化版本
主题 ▾
最新版本 ▾ git-check-attr 最后更新于 2.43.0
git-check-attr 手册中的更改
设置和配置
获取和创建项目
基本快照
分支和合并
共享和更新项目
检查和比较
补丁
调试
电子邮件
外部系统
服务器管理
指南
管理
底层命令
- 2.43.1 → 2.49.0 无更改
-
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
GIT
属于 git[1] 套件的一部分