开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜