Compdigitec Labs

« | Home | »

Deepen an existing shallow clone with git

By admin | January 31, 2012

In git, the new revolutionary DVCS system, to shallow clone a repository means to check out only the latest snapshot of a git repository, unlike a normal clone which pulls the entire repository. A shallow git repository can save bandwidth and take up less space.

git clone --depth=1 git://repo.example.com/mycoolapp

However, let’s say that once you checkout the project, compile it and decide that you want to contribute to it, then a shallow clone would probably not suffice. In this case, one can deepen the repository by using the following command inside the git repository, where n = number of revisions to deepen to:

git fetch --depth=n origin master

Saves more than having to re-clone everything from scratch and lose your working tree.

If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!

Topics: Linux | 6 Comments »

6 Responses to “Deepen an existing shallow clone with git”

  1. Lucky neko เว็บตรง lsm99 Says:
    March 24th, 2025 at 08:57

    … [Trackback]

    […] Info on that Topic: compdigitec.com/labs/2012/01/31/deepen-an-existing-shallow-clone-with-git/ […]

  2. http://aviatorwebsiteindia.org/ Says:
    April 1st, 2025 at 17:37

    … [Trackback]

    […] There you can find 40266 additional Info on that Topic: compdigitec.com/labs/2012/01/31/deepen-an-existing-shallow-clone-with-git/ […]

  3. boss45 คืออะไร Says:
    April 2nd, 2025 at 21:52

    … [Trackback]

    […] Find More on to that Topic: compdigitec.com/labs/2012/01/31/deepen-an-existing-shallow-clone-with-git/ […]

  4. 7 slots Says:
    April 5th, 2025 at 03:27

    … [Trackback]

    […] There you will find 76621 additional Info on that Topic: compdigitec.com/labs/2012/01/31/deepen-an-existing-shallow-clone-with-git/ […]

  5. pg168 Says:
    April 9th, 2025 at 03:49

    … [Trackback]

    […] Find More here on that Topic: compdigitec.com/labs/2012/01/31/deepen-an-existing-shallow-clone-with-git/ […]

  6. Aviator for Indian players Says:
    April 16th, 2025 at 05:28

    … [Trackback]

    […] There you will find 76025 additional Info to that Topic: compdigitec.com/labs/2012/01/31/deepen-an-existing-shallow-clone-with-git/ […]

Comments