Feature: git fetch single branch

Description of the feature request

Continuous from Git fetch single branch - #2 by viktorbenei

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.

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

1 Like

Hi @ctaggart,

We released a new version for Git Clone step (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!

2 Likes