I have a git repository for a hobby game i’m working on which I push to a private repository on github as a backup and central location for the code.
In old versions I have 100MB or so of .TGA files as textures but I’ve changed these to smaller .DDS files in newer version.
But when you clone the repository from github it still downloads all the unused old files as far as I can tell, not just the ones in the latest commit. This makes sense as you are cloning the repository, not just checking out the current version. But they are a useless large download most of the time.
But is there any way I can stop it downloading files from the oldest versions without preventing me from getting at them should I need to?
Failing that, how can I remove those old revisions, and the files that are no longer used from my remote repository?
Use the
--depthoption when you’re cloning it from GitHub, to get only the latest revision.From the manual…
If you’re wondering what options exist for Git commands, you can use
git help commandorman git-command.