`git lfs track` 做的不仅仅是写入 `.gitattributes` 吗?
Does `git lfs track` do more than writing to `.gitattributes`?
根据我的理解 .gitattributes
与 .gitignore
的工作方式类似。
如果我在.gitattributes
中定义了一个过滤器,这个过滤器就会生效,文件会被传输到LFS。
在每个 GIT LFS 相关文档(官方文档,Whosebug 答案,...)中建议 运行 git lfs track
.
除了将过滤器写入 .gitattributes
之外,git lfs track
还会做其他事情吗?
git lfs track
做了两件事:修改 .gitattributes
并调整时间戳,以便 Git 获取任何现有文件并将它们转换为 LFS 对象。此外,它还会进行一些健全性检查以避免重复和常见错误。
您没有理由不能自己修改 .gitattributes
,但请注意,如果您这样做,您还应该 运行 git add --renormalize .
以确保任何现有文件匹配相关模式转换为 LFS。
根据我的理解 .gitattributes
与 .gitignore
的工作方式类似。
如果我在.gitattributes
中定义了一个过滤器,这个过滤器就会生效,文件会被传输到LFS。
在每个 GIT LFS 相关文档(官方文档,Whosebug 答案,...)中建议 运行 git lfs track
.
除了将过滤器写入 .gitattributes
之外,git lfs track
还会做其他事情吗?
git lfs track
做了两件事:修改 .gitattributes
并调整时间戳,以便 Git 获取任何现有文件并将它们转换为 LFS 对象。此外,它还会进行一些健全性检查以避免重复和常见错误。
您没有理由不能自己修改 .gitattributes
,但请注意,如果您这样做,您还应该 运行 git add --renormalize .
以确保任何现有文件匹配相关模式转换为 LFS。