views:

39

answers:

1

Hello,

I'm in a situation where I don't want to commit my current changes to the trunk.

I would like to commit to a private branch and work there a little until I'm sure that everything is OK. I will merge changes made in my branch to the trunk.

What is the recommended procedure when you use SubVersion and TortoiseSVN ?

I have the classic directory structure:

  • /trunk
  • /branches
  • /tags

Thanks a million.

+3  A: 

This is an option in Tortoise, click on "branch/tag" from the context menu, then chose "working copy" from the radio buttons labled "create copy in the repository from:" and the new branch will come from your working copy.

In the "To Url" textbox, add in the path with the correct "/branches/" path to make sure it conforms to the structure you mentioned (branches/tags/trunk). Don't forget to give your branch a good meaningful name, and I find it useful in the comments to put in the revision number of the trunk which I'm branching from.

Alternatively, create the branch from the trunk seperately, then switch your working copy to the new branch, preserving your working copy, and commit to the branch from there.

Andrew M
Thanks Andrew. Could you suggest me a folder convention there ? All our versions are stored in the /branches, like this: /branches/1.0, /branches/1.1, etc. Would you suggest /branches/user/mydirtywork or something like that?
Pierre 303
Yeah, if you're happy and that's clear to your co-workers. You could name it after the project or piece of functionality if that would be even clearer. I've seen people name branches after themselves, but the risk is you end up with lots of them, like "Bobs_branch_2" and "Bobs_other_branch_2008" etc, which is a bit messy and tricky for the next person to grok.
Andrew M
Sorry didn't notice your extra folder "/user/" there, that would keep it cleaner. Be a little carefult with deep trees in SVN branches and tags though, as it's easy to people to checkout at the wrong level which either takes ages or can make a mess of a working copy.
Andrew M