本文介绍了gitignore按文件大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图实现Git来管理创意资产(Photoshop,Illustrator,Maya等),我想根据文件大小,而不是扩展名,位置等从Git排除文件。例如,我不想排除所有.avi文件,但在随机目录中有一些大量的+ 1GB avi文件,我不想提交。
有任何建议吗?
解决方案
我是.gitignore的新人,所以可能有更好的方法来做到这一点,但我已经排除文件的文件大小使用:
find。 -size + 1G | cat>> .gitignore
显然,如果你生成很多大文件。
I'm trying to implement Git to manage creative assets (Photoshop, Illustrator, Maya, etc.), and I'd like to exclude files from Git based on file size rather than extension, location, etc.
For example, I don't want to exclude all .avi files, but there are a handful of massive +1GB avi files in random directories that I don't want to commit.
Any suggestions?
解决方案
I'm new to .gitignore, so there may be better ways to do this, but I've been excluding files by file size using:
find . -size +1G | cat >> .gitignore
Obviously you'll have to run this code frequently if you're generating a lot of large files.
这篇关于gitignore按文件大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!