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

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

Avatar

1 badge earned

Collect

Participate in fun challenges

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

Challenges
Coins

Gift kudos to your peers

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

Recognition
Ribbon

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!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,507
Community Members
 
Community Events
176
Community Groups

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 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: 

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events