views:

216

answers:

4

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)

+1  A: 

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.:

svn copy working_directory url_to_branch
wierob
A: 

yes you can. I use tortoiseSVN and you can do it in that.

Nick
+2  A: 

In my SVN client: TortoiseSVN it is enough to:

  • right click on the top directory I want to branch
  • in "To URL" select the branch directory in your repository
  • in the frame "Create copy in the repository from:" select "Working copy"

done :)

It is just like copying local version to specified repository url.

twk
A: 

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

svn copy <file/path/to/working/copy> <URL/TO/REPOSITORY/BRANCH>

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.

Peter Parker