# Cloning git repository

**URL:** <https://discourse.cataclysmdda.org/t/cloning-git-repository/23929>\
**Category:** The Toolbox\
**Created:** [June 12, 2020, 4:17pm UTC](https://discourse.cataclysmdda.org/t/cloning-git-repository/23929 "2020-06-12T16:17:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Medi\_Ding](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/medi_ding/32/5091_2.png) [@Medi\_Ding](https://discourse.cataclysmdda.org/u/Medi_Ding)\
**Post date:** [June 12, 2020, 4:17pm UTC](https://discourse.cataclysmdda.org/t/cloning-git-repository/23929/1 "2020-06-12T16:17:54Z")

</div>

I am trying to clone my fork of the repository using Ubuntu 18.04.2 on my windows computer. However, the repository seems to be at least 2 GB and for some reason the cloning process seems to freeze indefinitely before all of the repository can be received. Is there a way I can download in a compressed form or get it in smaller portions?

---

<div class="post-metadata">

**Author:** ![anothersimulacrum](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/anothersimulacrum/32/10770_2.png) [@anothersimulacrum](https://discourse.cataclysmdda.org/u/anothersimulacrum)\
**Post date:** [June 12, 2020, 4:21pm UTC](https://discourse.cataclysmdda.org/t/cloning-git-repository/23929/2 "2020-06-12T16:21:13Z")

</div>

Yes - `git clone --depth=$COMMITS`. This will clone only the most recent `$COMMITS` commits.  
You can then expand it with `git fetch --deepen=$COMMITS` to grab `$COMMITS` commits before the ones you cloned.

---

<div class="post-metadata">

**Author:** ![Medi\_Ding](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/medi_ding/32/5091_2.png) [@Medi\_Ding](https://discourse.cataclysmdda.org/u/Medi_Ding)\
**Post date:** [June 12, 2020, 4:40pm UTC](https://discourse.cataclysmdda.org/t/cloning-git-repository/23929/3 "2020-06-12T16:40:04Z")

</div>

It seemed to say `depth is not a positive number` with 1 extra space behind depth.

I put `--depth=1$COMMITS` instead and it worked. Is this how it is supposed to work, like cloning the most recent set of commits?

Also, is the thing I just cloned all I need to build the most recent experimental version of the game, though not the previous versions?

---

<div class="post-metadata">

**Author:** ![anothersimulacrum](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/anothersimulacrum/32/10770_2.png) [@anothersimulacrum](https://discourse.cataclysmdda.org/u/anothersimulacrum)\
**Post date:** [June 12, 2020, 5:37pm UTC](https://discourse.cataclysmdda.org/t/cloning-git-repository/23929/4 "2020-06-12T17:37:51Z")

</div>

You’re supposed to replace `$COMMITS` with a number, sorry for not making that clearer.  
And yes, you won’t be able to build any previous versions or use any history, but you can build the experimental versions with a shallow clone.

---

<div class="post-metadata">

**Author:** ![Medi\_Ding](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/medi_ding/32/5091_2.png) [@Medi\_Ding](https://discourse.cataclysmdda.org/u/Medi_Ding)\
**Post date:** [June 13, 2020, 7:09pm UTC](https://discourse.cataclysmdda.org/t/cloning-git-repository/23929/5 "2020-06-13T19:09:06Z")

</div>

I can split up the download now, but how do I turn the shallow clone into a full one? Do I just keep deepening until there are no more commits left?

---

<div class="post-metadata">

**Author:** ![anothersimulacrum](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/anothersimulacrum/32/10770_2.png) [@anothersimulacrum](https://discourse.cataclysmdda.org/u/anothersimulacrum)\
**Post date:** [June 13, 2020, 8:50pm UTC](https://discourse.cataclysmdda.org/t/cloning-git-repository/23929/6 "2020-06-13T20:50:22Z")

</div>

Yep, that’s basically it. If you think you can do it one go, you can do `git fetch --deepen=10000000` to grab all the commits (pretty sure we have less than 10 million). Otherwise, just incrementally grab a few thousand.

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [June 13, 2020, 9:29pm UTC](https://discourse.cataclysmdda.org/t/cloning-git-repository/23929/7 "2020-06-13T21:29:25Z")

</div>

Also unless you’re doing heavy merging you don’t need more than a few hundred commits
