[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Question: Best way to create new branch after changes have al ready been made to trunk WC

From: Robert Hunter <robert.hunter_at_gen-i.co.nz>
Date: 2005-04-26 23:26:12 CEST

Mike Harris wrote:
> Here's my situation. I have made changes to my working copy of our
> trunk. After making a week's worth of changes, I now need to shelve the
> changes and move on to something else. What I want to do is check these
> changes into a branch, but my working copy points to the trunk. What is
> the best way to accomplish this? There are a couple ways I know of to
> do it, but they seem sub-optimal.
>
> 1. I could create the branch of trunk, check out a working copy, then
> copy the modified files into the branch working copy and check it in
>
> 2. I don't think this even works, but I could relocate (switch
> --relocate) my WC from trunk to the new branch and check in. This would
> be great, but I don't believe relocate can be used in this fashion.

Your simplest option is probably to copy your working copy to a branch,
instead of copying the trunk.
$ svn copy . $REPOS/branches/mybranch

I think it would make history and merging easier, though, if you were
to use switch method outlined above but NOT using the "--relocate"
option. The book should tell you more, but "svn switch" and
"svn switch --relocate" are two very different commands.

$ svn copy $REPOS/trunk $REPOS/branches/mybranch
$ svn switch $REPOS/branch/mybranch
$ svn commit

If there are un-merged changes from trunk, you might need to specify
a base revision to copy from when making the branch.

(Disclaimer: I am not a Subversion guru. Corrections welcomed.)

-- 
Robert Hunter
#############################################################################
This communication, including any attachments, is confidential.
If you are not the intended recipient, you should not read it - 
please contact me immediately, destroy it, and do not copy or 
use any part of this communication or disclose anything about it.
Thank You.
Please note that this communication does not designate an information system
for the purposes of the NZ Electronic Transactions Act 2002.
This email was scanned and cleared by NetIQ MailMarshal at Gen-i Limited.
#############################################################################
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Apr 26 23:30:09 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.