I did a checkout from my trunk to a local DIR and made lots of local changes there. Now I don't want to commit it back to the trunk, but I'd rather make a branch from this local version. Is that possible?
Can I just copy the trunk to a branch, and then cd DIR
and svn switch
to the branch?
UPDATE: Thanks for the answers, it worked! To summarize the steps:
cd DIR
svn copy . new-branch-URL
svn switch new-branch-URL .
(note the dots)
The SVN Book (http://svnbook.red-bean.com/en/1.6/svn-book.html#svn.branchmerge.using.create) doesn't recommend creating a branch from the local working copy.
Instead, create the branch first and then use the
svn switch
command so you can commit your changes. If your working copy is significantly out of date with the trunk then append "@REV" to the source URL where "REV" is the revision of your working copy reported bysvn info
.In my SVN client: TortoiseSVN it is enough to:
done :)
It is just like copying local version to specified repository url.
Yes, you can do this by SVN commandline as well as tortoiseSVN.
You have to specify your SVN workingcopy as src and your new branch as destination of the
command.
In TortoiseSVN just point into your working copy, choose "Branch/tag" from contextmenu and choose "Working copy" in the section "Create copy in the repository from:"
Note that it is not a good idea (for traceability reasons )to create tags in such a way, but for branches it is perfectly fine.
According to its command line help svn copy can copy from a directory to a repository URL. So you should be able to copy your working copy to the branch, e.g.: