【发布时间】:2014-08-19 11:18:14
【问题描述】:
我们的 git 存储库大约 600MB,因为有些图像是意外提交的。现在我们要从存储库中删除这些图像。如下:
$ du -hs .git/objects
606M .git/objects
$ git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch public/images/upload_xx/" -- --all
$ git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch public/images/upload_xx/" --tag-name-filter cat -- --all
$ rm -rf ../.git/modules/flipit_application/refs/original/
$ git reflog expire --expire=now --all
$ git gc --prune=now
$ git gc --aggressive --prune=now
$ du -hs .git/objects
65M .git/objects
在我的本地系统上,repo 从 600MB 变为 65MB。推动它:
$ git push --all --force
$ git push --tags --force
这些更改似乎被推送到了 bitbucket,但每当我拉取一个新的克隆时,它仍然是 600MB 以上。
我错过了什么?
【问题讨论】:
标签: git garbage-collection push bitbucket git-filter-branch