git - Why does my remote repo increase in size after bfg clean up?
问题描述
Used BFG to clean repo with large files.
I tried to follow step from bfg tutorial page.
Steps I followed:
git clone --mirror myrepo.git
java -jar bfg-1.13.0.jar --no-blob-protection --delete-folders "{large_folder}" test_repo.git
git reflog expire --expire=now --all && git gc --prune=now --aggressive
git push
The git push
did not worked for me I had to change denyNonFastforwards = true
to denyNonFastforwards = false
in my remote repo's config file.
So the problem I am having is the local repo size get shrunk but when I push to the remote remote repo size increase.
The strange thing is when I clone --mirror
that remote repo locally and see the size, it actually is small.
解决方案
You need to run 'git gc' on the remote repo too, which will trigger a collection of the now unused git objects.
More commonly, users have a git hosting service like GitHub as their remote, and the hosting service will periodically run 'git gc' for the users.
When you clone from a remote, only the essential data is sent- so you get only get the cleaned history, even if the remote repo has a bunch of unused git data lying around.
推荐阅读
- c - 叉子和管道,我做错了什么?
- c - 如何编写一个C程序来删除单链表中负元素之前的所有节点?
- sparql - 如何使用 SPARQL 查询获取 IRI 之间或某些 rdf:type 的两个节点之间的路径?
- python - 如何遍历唯一 ID 并计算日期值之间的差异并将值写入新列
- swiftui - SwiftUI 未知属性“可观察对象”
- javascript - 如何在 javascript 中重新分配 else if 以使其功能相同但键入为 elif?
- android - 通过网络请求回填时从 Room 发出协程流
- gnome-builder - 使用 Gnome-Builder 自动完成 Python 代码
- macos - 如何使用 ffmpeg 将多个 glob 输入加入时间间隔?
- terminal - 当我尝试运行“xcrun usdz_convert”时出现错误