How can I "force" a branch on a trunk, in case I cannot "reintegrate"?

We created a trunk from the trunk on which the main refactoring was done. Meanwhile, the trunk has reworked several fixes with some fixes. We don’t want to see these changes in the branch, so we don’t want to “catch up” to merge the trunk into the branch, because we don’t want to mix the old and new code, But without this I can’t reintegrate the branch back into the trunk.

Is there a way to put a branch on the chest "as is"?

(The idea I considered is to reverse (“reverse merge”) the connecting line back to the revision where the branch started, and then safely merge it on the branch - nothing should happen. Then I can reintegrate. Do you think? )

+4
source share
2 answers

Assuming you're fine in losing these changes, that is an acceptable solution, although you might want to consider just renaming the current trunk to a branch and renaming the trunk branch:

svn move https://path/to/repo/trunk https://path/repo/branches/newbranchname svn move https://path/to/repo/branches/refactoring https://path/to/repo/trunk 

Although, are you really sure that you do not want to make changes from the trunk? You can think about this very carefully. Even if you have done a lot of refactoring, if you used trunk work, you might want to look at it very carefully so that progress does not go to waste.

+6
source

You can use, as you said, reverse merging. Check in baggage

 svn merge -rHEAD:RevisionTheBranchWasCreated ^/trunk 

This will cancel all changes you have made after creating the branch. After this, the merge should work without problems.

Update: ^/trunk will only work on Linux. On Windows, you need ^^/trunk .

+3
source

Source: https://habr.com/ru/post/1308685/


All Articles