# Feature: git fetch single branch

**URL:** <https://discuss.bitrise.io/t/feature-git-fetch-single-branch/4321>\
**Category:** Released\
**Tags:** released\
**Created:** [March 1, 2018, 9:51pm UTC](https://discuss.bitrise.io/t/feature-git-fetch-single-branch/4321 "2018-03-01T21:51:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ctaggart](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/ctaggart/32/1242_2.png) [@ctaggart](https://discuss.bitrise.io/u/ctaggart)\
**Post date:** [March 1, 2018, 9:51pm UTC](https://discuss.bitrise.io/t/feature-git-fetch-single-branch/4321/1 "2018-03-01T21:51:38Z")

</div>

## Description of the feature request

Continuous from [Git fetch single branch - #2 by viktorbenei](http://discuss.bitrise.io/t/git-fetch-single-branch/4301/2)

```
git "init"
git "remote" "add" "origin" "ssh://APKAJXWOG7EOAQ5MFOAQ@git-codecommit.us-west-1.amazonaws.com/v1/repos/unity-examples"
git "fetch" "--depth=1"
git "checkout" "bitrise"

```

This downloads 158.47 MiB

The fetch command needs to pass in the branch to fetch. I think this should be the default always, but especially when depth is set. In this case, it would be:

`git fetch --depth 1 origin bitrise`

This downloads about 10 MiB.

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

This is a test repository of ours. I need this for our main application which has with avoid about 3 GiB of fetching.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 2, 2018, 5:29pm UTC](https://discuss.bitrise.io/t/feature-git-fetch-single-branch/4321/2 "2018-03-02T17:29:38Z")

</div>

Great idea, thanks for creating the #feature-request @ctaggart - I created an internal task for this as well and linked this feature request 😉

---

<div class="post-metadata">

**Author:** ![anon389916](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@anon389916](https://discuss.bitrise.io/u/anon389916)\
**Post date:** [March 20, 2018, 3:30pm UTC](https://discuss.bitrise.io/t/feature-git-fetch-single-branch/4321/3 "2018-03-20T15:30:27Z")

</div>

Hi @ctaggart,

We released a new version for `Git Clone` step ([4.0.10](https://github.com/bitrise-io/steps-git-clone/releases/tag/4.0.10)), which includes this feature. From the new version, only the affected branches are fetched to reduce build time. Thank you for the feature request!
