3

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 ?

Emerson
  • 1,327
  • 2
  • 15
  • 24

1 Answers1

5

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.

rlovtang
  • 4,860
  • 2
  • 30
  • 30
  • I know that... but this creates also the mybranch folder in the trunk folder ! so I have http://path/to/repo/trunk/mybranch/xxx and I like to have all projects directly under trunk – Emerson Dec 06 '10 at 14:36
  • @rlovtang: Your 'Note' is incorrect, the svn move commands will work on the server and any client at any path including paths that are a part of a working copy. – jgifford25 Dec 06 '10 at 16:38
  • @Emerson: Those steps will work as long as you use peg revision on the first URL of the second command. For more information on peg revisions, look here: http://svnbook.red-bean.com/nightly/en/svn.advanced.pegrevs.html – jgifford25 Dec 06 '10 at 16:40
  • @jgifford25 I wasn't taking about svn mv in general, but my example above. I'm aware that svn mv can be used on a WC. Updated the note for clarity, thanks. – rlovtang Dec 06 '10 at 21:20
  • @Emerson no, it does not create the mybranch folder, it creates the projectx folders directly under trunk – rlovtang Dec 06 '10 at 21:31
  • 1
    @Emerson if you want to play safe, you can backup the repo first, and try the commands. Then roll back if it doesn't work (it worked for me) – rlovtang Dec 06 '10 at 21:35
  • thanks.... I tried svn move and not svn mv.... this apparently makes a difference... or I did it wrong the last time... it works now like a charm ! – Emerson Dec 07 '10 at 09:57