SVN: replace the trunk with a branch

It is rather nightmarish when you need to merge the branch back into trunk because there are bound to be the many merge conflicts. To avoid torture, you could replace the trunk with you branch. This is especially attractive because you will retain the history of the branch. The solution proposed:

$ svn copy file:///repos/trunk file:///repos/tag/old_trunk -m "copied old trunk as tag"
$ svn del file:///repos/trunk -m "Temporarily deleted trunk."
$ svn copy file:///repos/branches/your_branch file:///repos/trunk -m "Copies /branches/your_branch to /trunk"

If you use a SVN server replace file:///repos with svn://

$ svn copy svn:// svn://svn.cartel.local/ -m "copied old trunk as tag"
$ svn del svn:// -m "Temporarily deleted trunk."
$ svn copy svn:// svn://svn.cartel.local/ -m "Copied /branches/1.0 to /trunk"

Leave a Reply