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

Rebase other PRs after squash

Krzysztof Sierszeń
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 29, 2024

Hi guys, 

I often find myself creating multiple branches off of one another, ending up with a structure like: 

main <-- branch1 <-- branch2

I will also typically want to merge branch1 into main first, and when I do that, BB (helpfully) re-targets the PR for branch2 to main. So far, so good. 

Problem is: we have a policy of squashing PRs, and this messes up branch2's diff against main (git sees the squashed commit on main as conflicting with the previously unsquashed version). 

So, I end up having to rebase branch2 onto main manually. 

Is there any option to tell BB to also do the rebase for me, once the PR for branch1 is merged? This would be a simple `git rebase --onto main branch2~N branch2`, where N is the no. of extra commits in branch2 vs. branch1. 

(of course, if there are any conflicts, I would still need to intervene, but that's like 5% of the cases)

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events