gitignore by file size?

前端 未结 5 670
难免孤独
难免孤独 2020-12-04 10:14

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

5条回答
  •  北海茫月
    2020-12-04 10:50

    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.

提交回复
热议问题