0

I realized my .git folder was taking up 1.3GB today and looked through the contents to see what the problem was. I found a .pack file taking up almost all of the space and searched around online, eventually running git gc --aggressive.

This fixed the .pack files, which are now much smaller in the byte or kb range. However, I now have an object file that's 1.3GB.

I can cat the contents of the object and I know what's in it but I can't find that file in my repo history. I don't actually remember committing it but I think php storm may have added it to the repo when I put it in my project directory.

How can I remove this large object file without damaging the repo?

Edit: I checked out the duplicate answer and ran both shell and perl scripts in this link: Which commit has this blob? to try to find the commit but both returned nothing and no errors either.

Does this mean this object really references no commits?

Community
  • 1
  • 1
Ethan22
  • 747
  • 7
  • 25
  • I'll try the second link in the answer and run that script to see if it will work for me. – Ethan22 Dec 06 '15 at 19:58
  • Neither of the scripts to find out which commit the object references returned anything – Ethan22 Dec 06 '15 at 20:08
  • Try pruning all unreachable objects: `git prune --expire=now` (be careful though, in case you want to recover unreachable objects from your repository). – knittl Dec 06 '15 at 20:12
  • See also: http://stackoverflow.com/questions/32787200/completely-remove-every-trace-of-git-commit/32787307#32787307 – abligh Dec 06 '15 at 20:13
  • @knittl `git prune --expire=now` worked but it just removed all the /bd/73b2d3c69a2dc3587c589ebbfa7ac4d0be6dd3 (etc.) files from the objects folder. So I'm not really sure what it did actually. Problem is solved though. Could I simply have done this by deleting the file from Finder myself? If you want to make that the answer I'll mark it. – Ethan22 Dec 06 '15 at 20:16
  • @Ethan22: you could have, but you wouldn't want to. `git prune` has a lot of safety checks in place, so you do not corrupt your repository accidentally. Deleting the file manually could result in a broken repository. – knittl Dec 06 '15 at 20:18
  • @Ethan22 I've marked the question I pointed to as a duplicate. – abligh Dec 06 '15 at 20:26

0 Answers0