Reputation: 1428
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-a
feature-branch
and squashes two previous commits into one. ticket-a
into feature-branch
Will 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.
Upvotes: 3
Views: 2150
Reputation: 1940
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
Upvotes: 3