How to move a branch in SVN to trunk?

Emerson picture Emerson · Dec 6, 2010 · Viewed 14.8k times · Source

how can I move a SVN branch into trunk ?

The problem I face is, that if I do a move command in SVN (command line or inside Eclipse) I only can move the branch folder into trunk, resulting to have that folder in trunk. But I want to have all content of that branch in the trunk.

E.g.

/branch/mybranch/project1,project2,project3

shall be

/trunk/project1,project2,project3

and not

/trunk/mybranch/project1,project2,project3

of course with project1,project2,project3 as 3 different projects...

how can this be done ? Does tortoise help here ? Or is this only possible with moving every project byitself ?

Answer

rlovtang picture rlovtang · Dec 6, 2010

move the current trunk to some other place (/branch/oldtrunk), then move /branch/mybranch to /trunk. (if what you wanted is to replace current trunk with the branch?)

With the command line client, this can be done with:

svn mv http://path/to/repo/trunk http://path/to/repo/branch/oldtrunk
svn mv http://path/to/repo/branch/mybranch http://path/to/repo/trunk

Note: in the example above, I used paths to operate directly on the server. This is easier for tasks like this, than operating on a working copy.