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

Push one or multiple commits to multiple branches

Ilgar Ilyasov September 20, 2019

Let's say I have a main develop and develop_10, develop_11, develop_12, develop_13 and etc branches

  • While I was working on develop_12 I realized and solved a bug which is relevant to all branches and want to push it to develop, develop_10, develop_11 and develop_13
  • Also if I solve a bug on develop and I want to push that to all develop_10, 11, 12... etc branches

Any solution other that cherry-pick?

1 answer

1 accepted

0 votes
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 20, 2019

Hello @Ilgar Ilyasov,

The answer depends on your branches structure.

If all these branches are completely independent and can't be merged one into another, the only way to avoid cherry-picking is to find a commit in the history that belongs to all branches in question (i.e. reachable from all these refs), create a branch off that commit, make a commit with a fix on that new branch and then merge it in every branch in question.

If you can make one-way merges (for instance, the branches denote your product releases, and version 11 should fully contain version 10, so develop_10 can be merged into develop_11), then you can fix the issue on the "oldest" branch, and then make a so called cascade merge of an older branch into the newer branch until you reach main develop branch. However, this might not always be trivial because of on your release mechanism.

Does this make sense? Let me know if you have any questions.

Hope this helps.

Cheers,
Daniil

Ilgar Ilyasov September 23, 2019

Thanks for the quick response @Daniil Penkin cascade merge makes sense

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events