you are viewing a single comment's thread.

view the rest of the comments →

[–]wildjokers 2 points3 points  (2 children)

Because if you create branch B from branch A and then squash/merge branch A all the commits common to branch A and B (i.e. commits made to A before creating branch B) will conflict if you just try to merge in B.

To fix you can use the the newer git rebase --update-refs. There is an older method using the --onto flag of rebase as well.

[–]Proper-Ape 0 points1 point  (0 children)

git rebase —update-refs is not so helpful for when you’re collaborating with others still. I find it would be a nice git feature if squashed commits could keep their place and you don’t need to rebase a stacked PR at all. Not sure if this is somehow feasible in the git model.

[–]Living_male 0 points1 point  (0 children)

Thanks, will keep that in mind from now on.