# Partial clones for git repos

**URL:** <https://discuss.bitrise.io/t/partial-clones-for-git-repos/15383>\
**Category:** Steps\
**Tags:** git, git-clone\
**Created:** [January 13, 2021, 8:45am UTC](https://discuss.bitrise.io/t/partial-clones-for-git-repos/15383 "2021-01-13T08:45:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dseither](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/dseither/32/3329_2.png) [@dseither](https://discuss.bitrise.io/u/dseither)\
**Post date:** [January 13, 2021, 8:45am UTC](https://discuss.bitrise.io/t/partial-clones-for-git-repos/15383/1 "2021-01-13T08:45:37Z")

</div>

## Description of the feature request

To save time while cloning a bigger git repository, I’d like the Git Clone Repository action to support blobless and/or treeless clones. This boils down to running `git clone --filter=blob:none <url>` or `git clone --filter=tree:0 <url>`. This is different from creating a shallow clone, which is supported. There’s a great writeup on the differences between these options on the GitHub blog: [Get up to speed with partial clone and shallow clone](https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/).

## Use case / for what or how I would use it

For some of our CI workflows, we need the full history of commits and tags etc., even though we only check out one or two branches in the process, or merge a branch into another. Think of creating a changelog from commit messages and tags, for example. A shallow clone wouldn’t cut it in this case because it doesn’t fetch the history.

Blobless and treeless clones are almost as fast as shallow clones, but they bring with them the full commit history, and also all trees in the case of the blobless clones. They also automatically download missing data (file contents, or file history in the case of a treeless clone) from the remote should it be necessary for something to function.

Here are some numbers for a repo with a longer history that I’ve tested this with:

| | Time to clone | Disk space used |
| --- | --- | --- |
| full clone | 57s | 681 MB |
| blobless clone | 7s | 38 MB |
| treeless clone | 8s | 33 MB |
| shallow clone | 4s | 30 MB |

The sweet spot for us would be the blobless clone. It would download everything we need in a fraction of the time of fetching everything, and without laying any restrictions on further use of the repo.

---

<div class="post-metadata">

**Author:** ![chaitanya.tanna](https://avatars.discourse-cdn.com/v4/letter/c/bc8723/32.png) [@chaitanya.tanna](https://discuss.bitrise.io/u/chaitanya.tanna)\
**Post date:** [January 20, 2021, 6:58pm UTC](https://discuss.bitrise.io/t/partial-clones-for-git-repos/15383/2 "2021-01-20T18:58:18Z")

</div>

Helo @dseither  
Thank you for reaching out to Bitrise.  
Thank you for the details of the use case for your feature request.  
I will provide this information to the team soon.

Thanks  
Chaitanya

---

<div class="post-metadata">

**Author:** ![pierpo](https://avatars.discourse-cdn.com/v4/letter/p/b9e5f3/32.png) [@pierpo](https://discuss.bitrise.io/u/pierpo)\
**Post date:** [November 24, 2021, 3:05pm UTC](https://discuss.bitrise.io/t/partial-clones-for-git-repos/15383/3 "2021-11-24T15:05:40Z")

</div>

Hey!

Any news on this matter? This would be really useful to improve our cloning speed 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![cathy.harmon](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/cathy.harmon/32/2674_2.png) [@cathy.harmon](https://discuss.bitrise.io/u/cathy.harmon)\
**Post date:** [November 24, 2021, 5:34pm UTC](https://discuss.bitrise.io/t/partial-clones-for-git-repos/15383/4 "2021-11-24T17:34:43Z")

</div>

Hello,

We receive a number of feature requests and would love to implement them all! Unfortunately, we have limited resources and this is not possible. We do review the feature requests and are constantly re-assigning priorities so we can’t really provide updates on specific feature requests. We have to consider the impact of the feature request, the effort involved, the number of users it would benefit, and lots of other items.

- cathy
