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

How can I manipulate a branch that is not the triggering branch in a pipeline?

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?

1 answer

1 accepted

1 vote
Answer accepted
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 27, 2022

Hey @Christof Koegler _Gaims GmbH_ 

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. 

clone:
depth: full # include full clone
pipelines:
default:
- step:
name: Cloning
script:
- echo "Clone all the things!"

Cheers,
Syahrul

Suggest an answer

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

Atlassian Community Events