简体   繁体   中英

Does `git lfs track` do more than writing to `.gitattributes`?

From my understanding .gitattributes works similar as .gitignore . If I define a filter in .gitattributes , this filter will take effect and the files will be transferred to LFS.

In every GIT LFS related document (official documentation, stackoverflow answers, ...) it is recommended to run git lfs track .

Does git lfs track do anything else than writing the filter to .gitattributes ?

git lfs track does two things: modify .gitattributes and adjust timestamps so that Git picks up any existing files and converts them to LFS objects. In addition, it does some sanity-checking to avoid duplicates and common mistakes.

There's no reason you can't just modify .gitattributes yourself, but note that if you do that, you should also run git add --renormalize . to make sure that any existing files matching the relevant patterns are converted to LFS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM