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 | 8 Comments »

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

  1. wings789 Says:
    November 12th, 2024 at 06:04

    … [Trackback]

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

  2. dark168 Says:
    November 12th, 2024 at 15:00

    … [Trackback]

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

  3. poker online Says:
    November 27th, 2024 at 21:05

    … [Trackback]

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

  4. ข้อดี-ข้อเสียของเว็บ สล็อต 168 Says:
    December 5th, 2024 at 20:00

    … [Trackback]

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

  5. pgslot Says:
    December 8th, 2024 at 22:28

    … [Trackback]

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

  6. สาวถ้ำ pg เกมสล็อตแตกง่าย Says:
    December 9th, 2024 at 18:47

    … [Trackback]

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

  7. cake disposable vape Says:
    December 17th, 2024 at 17:29

    … [Trackback]

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

  8. สล็อตเว็บตรง ระบบเกมมั่นคง Says:
    December 19th, 2024 at 06:26

    … [Trackback]

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

Comments