2

We use GitHub to host all my projects, and we've got a 6GB soft-limit. A few days ago, there were many files added to the repository which should not have been added (such as images, movies, etc.) which pushed the repository size to 2.4G:

$ du -sh .git
2,4G    .git

These changes were pushed to GitHub, but the Disk Usage there increased by almost 2 times the size of the .git folder. How is that possible? Am I missing something here? I always thought that the size of the repository was the same as the size of the .git folder.

1
  • Have you tried git's garbage collection yet?
    – Marcin
    Apr 1, 2011 at 1:43

1 Answer 1

3

This is because the objects on the server have not been deleted--they've just been orphaned. Unfortunately, running git gc --prune=now locally won't have any affect on the remote server. The good news is, the default prune age is two weeks, and GitHub runs this periodically. This means that any orphaned blobs/commits older than two weeks will be removed.

If you want the extra binaries removed immediately, you can go ahead and delete/recreate the repository on GitHub. Make sure you garbage collect locally before pushing to the new repository. Hope this helps!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .