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
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
I have the following scenario:
Whenever file A changes in branch 'develop', I want to copy these changes to branch 'main'.
I added a step to my pipeline which triggers whenever file A changes in branch 'develop', but apparently Bitbucket only clones the triggering branch, so 'main' is not available in the pipeline.
I have tried to fetch, pull, checkout -b, etc. but to no avail. I also tried re-cloning the whole repository, but have run into permission issues.
How can I go about this?
Welcome to the community.
I believe you are missing the 'main' branch because, by default, the Bitbucket pipeline only does a shallow clone of your repository, which only includes the triggered branch.
To fix this, simply add full clone depth in your YAML which should trigger the full clone as mentioned in our guide here.
depth: full # include full clone
- echo "Clone all the things!"