`git clone` and `git pull` a lot faster

So you replaced your system and want to start fresh? Or you lost your projects folder, but it’s still hosted on a git server somewhere? Or you thought you were done with this one project, that lasted forever, but now you need to do a small update? You don’t want to wait for your crappy internet to download that 6 years of work in a 4 GB git repository? Worry no more!You can tell git to only download the latest commits and save hours and tons of history being saved to your local system.

Use the following to only download the last commit and you’re done!

git clone --depth 1 ssh://.......

After which your local repository will only have a single commit and is known as a shallow repository. Using {{git pull}} stays within the limits of this shallow repository, but if you want to get the full history back, use:

git pull --unshallow

Now be productive!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.