Git LFS 递归跟踪文件夹
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35769330/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git LFS track folder recursively
提问by csa
Is it possible to track recursively all files contained in a folder and its subfolders with Git LFS ?
是否可以使用 Git LFS 递归跟踪文件夹及其子文件夹中包含的所有文件?
I would like to do something like this :
我想做这样的事情:
git lfs track myfolder/*
回答by sschuberth
Use git lfs track "myfolder/**"
, with quotes to avoid the shell already expanding the pattern. All that the track
command does is to write to .gitattributes
, which in turn uses (almost) the same pattern matching rules as .gitignore
, see the PATTERN FORMATdescription.
使用git lfs track "myfolder/**"
带引号的 , 以避免 shell 已经扩展了模式。该track
命令所做的只是写入.gitattributes
,而后者又使用(几乎)与 相同的模式匹配规则.gitignore
,请参阅PATTERN FORMAT描述。