0

I have a git repo, locally it was 3.9GB, cloning it freshly 3.3GB, it had some giant files in it, but I used https://stackoverflow.com/a/8741530/7857013 to remove them from git history.

Now locally my repo is 1.5GB, and cloning it freshly it is 80MB! The 1.5GB is in ./.git/objects. How come it is still so big locally, and how do I fix it?

Quickly before anybody says 'local branches'. The repo has 1 branch, and never had more than that one main branch (locally or remote).

Koen
  • 174
  • 1
  • 10

2 Answers2

1

cloning it freshly it is 80MB

Then push every branch (just to be safe) and throw your whole folder away and do your fresh clone.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • This is obviously a solution, but does not help anyone understand why the size is there – Koen Jun 10 '21 at 08:24
  • https://stackoverflow.com/questions/1904860/how-to-remove-unreferenced-blobs-from-my-git-repo – matt Jun 10 '21 at 14:42
0

Try with git gc --aggressive.

Let me known if it worked.

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74
  • I did, ```git gc --aggressive --prune=now``` specifically, just like it says at the answer of the link in my question – Koen Jun 10 '21 at 08:27