nasa-jpl / open-source-rover

A build-it-yourself, 6-wheel rover based on the rovers on Mars!
https://open-source-rover.readthedocs.io
Apache License 2.0
8.62k stars 1.37k forks source link

Git repo history is large, consider recommending --depth 1 #464

Closed robrussell closed 7 months ago

robrussell commented 7 months ago

When cloning the repo with

git clone https://github.com/nasa-jpl/open-source-rover.git

The resulting folder is 3.4GB, mostly under .git/objects:

$ du -hcd2 | sort -h
...
2.9G    ./.git/objects
3.4G    .
3.4G    total

The size isn't a whole lot by today's standards but it took a while to clone the repo from github.

After cloning it I tried a couple things to see if the size could be easily reduced. First I tried using git gc --aggressive --prune and then git repack -a -d -f --depth=250 --window=250 but it was still around 3.4GB. I think it's just because of the long history with some large files. Most users will only need the most recent revisions so it'd be good to include something in the instructions or the contributions page like

git clone --depth 1 https://github.com/nasa-jpl/open-source-rover.git

This doesn't pull the whole history with the repo but it gets all the current files. I think it's sufficient even for most contributors. The resulting directory has only 883M in it today, about half of that is under the .git/ folder.

Achllle commented 7 months ago

Yes that's because we used to include solidworks files in this repo. They've now moved to OnShape. Using depth 1 is a good rec, would you like to make a PR for it?

robrussell commented 7 months ago

Sure, I should be able to do that tonight.