I'm in a situa开发者_StackOverflow社区tion 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
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.
There is now an experimental client-only option to "Shelve" changes available from the context menu. This gathers the changes up on the client under a name you give them. Since these changes will not be stored in the repository, they will not be visible to others. You can later "Unshelve" them to get your changes back. See the documentation page for more details.
The main caveat is that Shelving is experimental. Upgrading your SVN client may invalidate existing shelved change sets should the format change.
精彩评论