The history goes as follows:
- Create branch from main.
- Change directory structure on trunk.
- Add new files to the old directory structure on the branch.
The usual approach for merging goes as follows:
- Merge trunk changes to branch
- Merge branch back to trunk
However, in my situation step 1 will already result in tree conflicts.
How can I best deal with this task?
Ps: Possible duplicate has no accepted answers.
First merge all trunk changes into your branch, resolving conflicts. This will very likely conflict with the changes you have made to the trunk, but if you want to merge those changes made to different branches, you ultimately will have to resolve those conflicts, and this is the place to do that.
Then reintegrate the branch into the trunk. (Note that the branch is not fit for further merges once it’s reintegrated. The best is to delete it.)
One thing you can do to lessen the pain of having too many conflicts piling up is to merge changes step-by-step, rather than merging them all at once. I sometimes find it easier to understand the changes I am merging when there aren’t so many of them. And understanding the changes might be the most important aspect of successfully merging conflicts.