You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.