Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Curiosity about depth when cloned in pipeline

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.

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 06, 2022

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: 

depth: full # include the full history

- step:
name: Cloning
- 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

Suggest an answer

Log in or Sign up to answer
Site Admin
AUG Leaders

Atlassian Community Events