Reputation: 32068
I have done a master -> feature
merge to update and resolve conflicts before the actual merge.
Can I rebase feature onto master instead and apply the conflict resolution from the merge?
o - TODO merge feature -> master |\ | o feature - "Merge remote-tracking branch 'origin/master' into feature" |/| o | master | o - "Implement some new feature here" | | ... |/ oWhat I want:
o - TODO merge feature -> master |\ | o feature - "Implement some new feature here" |/ o master | ... | o
I want to merge a feature branch that is quite old and has conflicts, because other work was merged to master in the mean time. First I updated the feature branch from master by a master -> feature
merge. Now I am able to successfully merge the feature branch back without conflicts. But looking at he history now, I realised I should have rebased my feature onto the latest master instead. Unfortunatelly I had to resolve quite an amount of conflicts, can I reuse the current state?
Upvotes: 3
Views: 67
Reputation: 12325
As Tim Biegeleisen commented, you can't reuse the merge commit (which is where you resolved your conflicts) in a rebase directly.
The merge conflicts are resolved in a the merge commit, which will drop off when you do the rebase master
command.
However, if there merge conflicts were especially painful and/or if you only have a few commits that you're working with, you could follow a workflow of:
master
into featureBy doing the soft reset, the actual file changes after the merge are preserved so you won't need to resolve the conflicts the way you'd need to do if you were just rebasing.
Upvotes: 1