Possible to purge all git data before a specific commit?
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.
精彩评论