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.