我正在尝试清理 openshift git 存储库。 .git 中的对象文件夹似乎很大。我可以通过 ssh 进入应用程序并执行命令
git reflog expire --expire=now --all
git gc --prune=now --aggressive
服务器在执行命令时重新启动,连接断开。对于应小于 100 MB 的应用程序,对象文件夹的总大小超过 3 GB。 请指教。谢谢。
最佳答案
git gc
alone can increase the size of your repo .
我更喜欢:
git gc
git repack -Ad # kills in-pack garbage
git prune # kills loose garbage
reflog part can be used to remove unreferenced elements并且会排在第一位:
git reflog expire --expire-unreachable=now --all
git gc --prune=now
关于git - 删除 openshift git/objects 文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43152402/