Support for more clone options at the step level

We recently shipped an improvement to Bitbucket Pipelines that allowed users to disable the git clone operation for specific steps, saving time for steps that don't need the source code. Building on that work, we are happy to announce that you can now also specify the lfs and depth options in your step-level clone section. lfs controls whether files that have been checked in with Git LFS are checked out, while depth controls how much history is cloned.

These options work the same as what you can already specify in the global clone section (see our docs for more information). As usual, the step-level configuration takes precedence over the global one.

This should give you even more flexibility in your pipelines to only checkout what you need for a specific step!

Here is an example of configuration:

pipelines:
  default:
    - step:
      name: checkout everything
      script:
        - echo "do something"
    - step:
      name: checkout with a depth of 1
      clone:
        depth: 1
      script:
        - echo "do something else"
    - step:
      name: checkout with LFS
      clone:
        lfs: true
      script:
        - echo "I need that big file..."
    - step:
      name: don't checkout anything
      clone:
        enabled: false
      script:
        - echo "I don't need the source code..."

Happy coding!