gitignore by file size?

2019-01-31 11:48发布

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?

1条回答
啃猪蹄的小仙女
2楼-- · 2019-01-31 12:36

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.

查看更多
登录 后发表回答