3

我有一个托管在 github 上的项目有点臃肿:

https://github.com/ColinEberhardt/PropertyCross/

回购现在大约 160 MB。我想做一些清理工作,将一些文件移动到单独的存储库中,以便克隆主存储库的“成本”更小。我已经研究了如何做到这一点,我很高兴 git 允许我从存储库索引中删除文件夹,从而减小了整体大小。我也知道这是一个破坏性的操作。

我的问题是,如果我执行这个操作,并且强制推送到 github,对已经 fork 项目的人有什么影响?如果他们对他们的分叉进行更改并提出拉取请求,我仍然可以将它们合并吗?(我不介意手动执行此操作)。

或者,这是否会导致他们的分叉无用?

4

1 回答 1

1

your repository is actually 70 MB (as you self say in https://github.com/tastejs/PropertyCross/issues/189 ). This is the packed size of the git repository and does not include the size of your working directory.

It is this size that gets cloned. Your repository was about 70 MB in size even with your website/-directory. All code that you removed in commit 1faf01c04cb46df893592268407c3d84c403592f is still in the repository and is possible to get back. Every clone still downloads this.

To reduce your git-repo size you can run git gc. It will clean up a few things for you. To really remove stuff from your repo, (like ripping out the website-directory all together) you will need to use something like git filter-branch. You can a good tutorial about it here https://confluence.atlassian.com/display/BITBUCKET/Maintaining+a+Git+Repository

There's a few other tricks to try to recompute your storage (git repack, git gc --aggressive etc.). I tried those on your repository and could not make it below 70 MB in size. Actually I got a worse size (72 MB). I guess that your repository already is pretty good packed.

于 2013-06-29T14:26:46.120 回答