How to commit current changes in a new branch using TortoiseSVN and Subversion

branchsvntortoisesvn

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

Best Answer

This is an option in TortoiseSVN. Click on Branch/tag... from the context menu, then choose "Working copy" from the radio buttons labeled "create copy in the repository from:" and the new branch will come from your working copy.

In the To path 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 separately, then switch your working copy to the new branch, preserving your working copy, and commit to the branch from there.