gitignore 按文件大小? [英] gitignore by file size?

查看:30
本文介绍了gitignore 按文件大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实施 Git 来管理创意资产(Photoshop、Illustrator、Maya 等),我想根据文件大小而不是扩展名、位置等从 Git 中排除文件.

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.

例如,我不想排除所有 .avi 文件,但是在我不想提交的随机目录中存在少量大量 +1GB avi 文件.

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.

有什么建议吗?

推荐答案

我是 .gitignore 的新手,所以可能有更好的方法来做到这一点,但我一直使用以下方法按文件大小排除文件:

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 按文件大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆