如何收缩git pack文件

时间:2018-01-09 07:27:58

标签: git

我有使用Android应用程序的git repo,看起来其中一个开发人员没有正确gitignore所以.apk文件已经提交并且repo变得很大(repo是~300Mb,应用程序大小是~30Mb)。

我删除了一些垃圾:

git filter-branch --index-filter 'git rm --cached --ignore-unmatch ./app/release/app-release.apk' --tag-name-filter cat -- --all

git filter-branch --index-filter 'git rm --cached --ignore-unmatch ./app/build/outputs/apk/debug/app-debug.apk' --tag-name-filter cat -- --all

回购规模变小,现在为200Mb, 但是当我在寻找大提交时:

git verify-pack -v .git/objects/pack/pack-*.idx | sort -k 3 -n | tail -20

我仍然看到包含.apk文件的提交,但我甚至无法检查这些提交: enter image description here

所以问题是如何缩小包文件?

0 个答案:

没有答案
相关问题