Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have, over the course of the last few days, removed several hundred megs of large text and binary files from a git repository that I had set up recently (I am relatively new to git).

I did this in order to reduce the amount of time it takes to clone this repository on a remote machine.

However, the repo itself is still huge, and it still takes forever to clone. I suspect that git is keeping some manifestation of the large files in order to maintain some history.

How might I remove these objects, to make my repository "lean and mean"?


share|improve this question
Similar question here – Sean Reifschneider Nov 14 '10 at 23:01
up vote 5 down vote accepted

You need to remove the history that contains those large files. See this blog post on the subject.

share|improve this answer

Please try following command.

git gc --aggressive

share|improve this answer

Your Answer


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.