How to reduce disk space usage in a large repository?

一曲冷凌霜 提交于 2019-12-01 00:41:05
VonC

The three main options are:

On the last point, see "How do I remove the old history from a git repository?", using a script like this one (with the SHA1 of the commit from 2 months ago, as a parameter)

#!/bin/bash
git checkout --orphan temp $1
git commit -m "Truncated history"
git rebase --onto temp $1 master
git branch -D temp

# The following 2 commands are optional - they keep your git repo in good shape.
git prune --progress # delete all the objects w/o references
git gc --aggressive # aggressively collect garbage; may take a lot of time on large repos

Since it rewrites the history, you will need a git push --force.
Since the OP is pushing to git.assembla.com (see discussion), this issue clearly states

You need to enable the --force option.
This is done from the Git repository Settings tab. You need to be an 'Owner' on the space to see the settings tab.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!