Shallow clone a Git repository

Description

You can speed up the cloning of repositories by specifying clone depth. For pull request builds, you need to set the depth history to a number where both the source and destination branches are contained.

Instructions

  1. Add the Git Clone Repository Step.

  2. Set the Limit fetching to the specified number of commits input variable based on the build you are running:

    • If you are running a build on a single branch, set it to 1.

    • If you are running a pull request build, set it to a depth that contains both the source and target branches. For example, 100.

bitrise.yml

- git-clone@6:
    inputs:
    - clone_depth: 1