我们可以在不同的 repo 子文件夹中拥有多个 .gitattributes 文件吗?

Joa*_*oCC 4 git gitattributes

有没有办法拥有多个 .gitattributes 文件,每个子文件夹中有一个文件(在本例中是为了对 LFS 进行更模块化的管理)?

或者 .gitattributes 与 .gitignore 不同并且仅支持存储库根目录下的单个文件?

谢谢

phd*_*phd 9

https://git-scm.com/docs/gitattributes :

When deciding what attributes are assigned to a path, Git consults $GIT_DIR/info/attributes file (which has the highest precedence), .gitattributes file in the same directory as the path in question, and its parent directories up to the toplevel of the work tree (the further the directory that contains .gitattributes is from the path in question, the lower its precedence). Finally global and system-wide files are considered (they have the lowest precedence).

即,您可以.gitattributes在整个工作树上散布任意数量的文件。与 相同.gitignore