开发者

How to move a specific trunk revision and its subsequent edits to a branch? [duplicate]

开发者 https://www.devze.com 2023-04-09 03:46 出处:网络
This question already has answers here: How do I properly branch post-commit and revert the trunk in svn?
This question already has answers here: How do I properly branch post-commit and revert the trunk in svn? (4 answers) Closed 8 years ago.

We realized that we would like some work in the trunk to have actually have been in a branch. We would like several commits to go into a branch, and preferably, we would preserve the history of the commits. So:

r0 --- r1 --- r2 --- r3

wou开发者_JAVA百科ld become

          branch --- r2 --- r3
         /
r0 --- r1 ----- *

Where "*" is where we will start making new commits to the trunk. I'm nervous that I'll destroy our repository if I do something incorrectly. Please advise, thank you!


Basically the current status of trunk is good for the branch, so you should just do a server-side svn copy from trunk to the desired branches subdirectory:

svn copy svn://path/to/trunk svn://path/to/branches/foo -m "Creating branch Foo"

Then you would need to revert trunk to r1, which is easily achieved by either applying a reverse patch from r1 to r3 or by actually using svn merge:

svn merge r3:r1 svn://path/to/trunk

EDIT: Actually, there's a better solution here: How do I properly branch post-commit and revert the trunk in svn?

0

精彩评论

暂无评论...
验证码 换一张
取 消