Let's say we have a feature branch called feature-branch. Developers branch of this branch for their tickets and then open a PR to feature-brach.
If the following happens:
feature-branch and develops on a branch ticket-afeature-branch and squashes two previous commits into one. ticket-a into feature-branchWill there be a merge conflict or any issues? Since the ticket-a branch will have two commits where as the feature-branch will only have one as the two commits were squashed.
If you have something like:
Ancestor -- A -- B
\-- C
And you do a squash:
Ancestor -- AB
\-- A -- B -- C
You would be changing your history branch and creating a new commit with a new hash. Therefore, if you attempt to merge those two branches, git will try and find their common ancestor and begin your merge from there. But A doesn't contain all the changes AB does, which can cause conflicts.
To fix this, I suggest you rebase your other branch so it will contain the squashed commit. You can accomplish this with rebase onto from your second branch:
git rebase --onto AB C branch2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With