Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Have you tried git's garbage collection yet? –  Marcin Apr 1 '11 at 1:43
add comment

1 Answer

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!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.