When I ran the pipeline, I didn't set the depth separately,
but I could see that it was running as `git clone -n --branch {MY_BRANCH} source` or running as `git clone --brach {MY_BRANCH} --depth 50 source` depending on the case.
I would like to know about the conditions for being cloned.
Hello @Ray ,
Thank you for reaching out to Atlassian Community!
Bitbucket pipelines indeed use a shallow clone by default to clone your repository into the build container. This is implemented to reduce the time spent in cloning the repository to the build environment, especially for large repositories. Usually, your build will just need the most recent commits, so there would be no need to clone the older ones. By default, we clone only the last 50 commits.
However, it's possible to configure the depth of the clone in your pipeline in case you need to access older commits or have a full clone of the repository. This is sometimes necessary when working with other tools that do not support shallow clones.
To change the clone depth you can use the clone:depth attribute as in the below example:
clone:
depth: full # include the full history
pipelines:
default:
- step:
name: Cloning
script:
- echo "Clone all the things!"
The depth value can be a whole number greater than zero. Use full for a full clone.
More details in Configure bitbucket-pipelinesyml : Clone
Hope that helps! If you have any questions, feel free to ask.
Than you, @Ray .
Patrik S
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.