

Steve Lorek, How to Shrink a Git Repository This tutorial allowed me to shrink my repository from 60 MB to < 1 MB.

After some searching I found a great tutorial which makes it easy to delete the large generated files. The problem was I had accidentally checked in some generated large files.

I tried these but my repository was still very large. You can go back and delete some files but then you have to re-write your history from then to now and then force push then new repo to your origin. A common example of that is when you accidentally check in your passwords in git. To delete those kind of data permanently from your repo you have to re-write your history. Will this get rid of binary data that is orphaned in my repo? "git repack" will not git rid of images or binary data that you have checked into your repo and then deleted it. Old deltas", since you now are actually trying to make sure that this one The window thing is about how big an object window we want each deltaĪnd here, you might well want to add the "-f" flag (which is the "drop all (make them longer for old history - it's worth the space overhead), and Where that depth thing is just about how deep the delta chains can be The equivalent of "git gc -aggressive" - but done *properly* - is toĭo (overnight) something like git repack -a -d -depth=250 -window=250 Here is what the creator of git Linus has to say about how to shrink your git repo:
