开发者

Possible to purge all git data before a specific commit?

开发者 https://www.devze.com 2023-01-06 10:07 出处:网络
I have a few repos (for websites) that are 开发者_运维百科growing very large due to the fact that images constantly change.

I have a few repos (for websites) that are 开发者_运维百科growing very large due to the fact that images constantly change.

Is there a way to remove old data from git in order to reduce the size of the repo?


git filter-branch can do this, but I'd strongly urge you to actually think more deeply about your workflow before plowing ahead with this now and planning to repeat it again in 6 months.


Since you didn't specify whether you are already doing this, the documentation states that you should run git gc occasionally:

Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance.

Obviously this won't trash your history, but it should drop the repo size a bit if you haven't been running it. Don't be afraid to throw the --aggressive option in there either.

0

精彩评论

暂无评论...
验证码 换一张
取 消