views:

23

answers:

1

We have developed version 2.0 of our website, in a branch. Now the site is live, and we want our branch to replace the trunk (inkl. all history etc.).

We made a few bug fixes to the trunk, but they are all integrated in the branch. That is... all code in the trunk are dead code, and we want the trunk exactly like the branch..

Which steps should we take to rebase (is that the right term) our branch to the trunk in Subversion?

+2  A: 

svn can not rebase, since the entire repo is under version control. To rebase is inserting changes into the beginning of a branch. svn has basically no branches.

What you need to do is copy or move your brach to the trunk.

copy:

svn rm trunk
svn cp branches/live_site trunk

or move:

svn rm trunk
svn mv branches/live_site trunk

If you like you can also try to merge the branch into the trunk.

cd trunk
svn merge branches/live_site
Sean Farrell
Thanks for answering. Do you know if any of these methods methods will keep my history from the branch? svn rm... that is a delete, right? If I want to keey my trunk, could I then do something like this "svn mv trunk branches/version1" and then "svn mv branches/live_site trunk"?
Thomas Jespersen
Unless you merge, you will "lose" the history of thunk. The branch history will move with the cp or mv command. I said "lose", since nothing is really lost with any scm tool. You will have to go back in a couple versions to see the files. You can actually copy the trunk to a branch or tag first if you like.
Sean Farrell