You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by dieter oberkofler <do...@gmail.com> on 2009/07/02 07:04:31 UTC
Efficient way to create a new branch from an existing working copy
The typical way how we create a new branch from a trunk is by copying the
trunk to a new branch on the server and then checkout the new branch to a
local working copy.
As this is a very common procedure, I was wondering if this can eventually
also be done in a more efficient/fast way.
Is there way to - instead of checking out the new working copy - physically
duplicate the working copy and then somehow tell Subversion to take this new
directory as the working copy on the server?
Thank you,
Dieter
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2367263
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
RE: Efficient way to create a new branch from an existing working
copy (SOLVED)
Posted by dieter oberkofler <do...@gmail.com>.
Excellent!
This is just what I was looking for.
Thank you,
Dieter
> -----Original Message-----
> From: Johan Corveleyn [mailto:johan.corveleyn@uz.kuleuven.ac.be]
> Sent: Thursday, July 02, 2009 09:43
> To: 'doberkofler.lists@gmail.com'; users@subversion.tigris.org
> Subject: RE: Efficient way to create a new branch from an
> existing working copy
>
> > The typical way how we create a new branch from a trunk is
> by copying
> > the trunk to a new branch on the server and then checkout the new
> > branch to a local working copy.
> > As this is a very common procedure, I was wondering if this can
> > eventually also be done in a more efficient/fast way.
> > Is there way to - instead of checking out the new working copy -
> > physically duplicate the working copy and then somehow tell
> Subversion
> > to take this new directory as the working copy on the server?
>
> I think you're looking for "svn switch":
> -------
> $ svn help switch
> switch (sw): Update the working copy to a different URL.
> usage: 1. switch URL[@PEGREV] [PATH]
> 2. switch --relocate FROM TO [PATH...]
>
> 1. Update the working copy to mirror a new URL within the
> repository.
> This behavior is similar to 'svn update', and is the way to
> move a working copy to a branch or tag within the same
> repository.
> If specified, PEGREV determines in which revision the
> target is first
> looked up.
> ...
> -------
>
> So, suppose /path/to/wc-from-trunk is your trunk working
> copy, you might try the following scenario:
> $ svn copy <url>/trunk <url>/branches/my-branch $ cp -r
> /path/to/wc-from-trunk /path/to/wc-my-branch $ svn switch
> <url>/branches/my-branch /path/to/wc-my-branch
>
> Just be careful with local modifications or unversioned files
> that you still had laying around in your trunk WC (they will
> be copied to your new branch WC, so you'd carry them with
> you). Keep an eye on the output of the svn switch command to
> see if everything goes smoothly ...
>
> Regards,
> Johan
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2367269
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
RE: Efficient way to create a new branch from an existing working
copy
Posted by Johan Corveleyn <jo...@uz.kuleuven.ac.be>.
> The typical way how we create a new branch from a trunk is by
> copying the
> trunk to a new branch on the server and then checkout the new
> branch to a
> local working copy.
> As this is a very common procedure, I was wondering if this can
> eventually
> also be done in a more efficient/fast way.
> Is there way to - instead of checking out the new working copy -
> physically
> duplicate the working copy and then somehow tell Subversion to take
> this new
> directory as the working copy on the server?
I think you're looking for "svn switch":
-------
$ svn help switch
switch (sw): Update the working copy to a different URL.
usage: 1. switch URL[@PEGREV] [PATH]
2. switch --relocate FROM TO [PATH...]
1. Update the working copy to mirror a new URL within the repository.
This behavior is similar to 'svn update', and is the way to
move a working copy to a branch or tag within the same repository.
If specified, PEGREV determines in which revision the target is first
looked up.
...
-------
So, suppose /path/to/wc-from-trunk is your trunk working copy, you might try the following scenario:
$ svn copy <url>/trunk <url>/branches/my-branch
$ cp -r /path/to/wc-from-trunk /path/to/wc-my-branch
$ svn switch <url>/branches/my-branch /path/to/wc-my-branch
Just be careful with local modifications or unversioned files that you still had laying around in your trunk WC (they will be copied to your new branch WC, so you'd carry them with you). Keep an eye on the output of the svn switch command to see if everything goes smoothly ...
Regards,
Johan
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2367268
To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].