开发者

2 Checkouts of one SVN Trunk, how to convert one of them to a branch?

I have two checkouts of one trunk of a project via SVN. One is the 'Feature Checkout', which includes work on new features/upgrades, that will rolled out to production code every few months. The second is the 'Support Checkout', which is for any small day-to-day bug开发者_运维问答 fixes that arise.

My Feature Checkout already contains a lot of code that I can't afford to lose, but is far from being ready to go live. What I am looking to do is to create a new branch of the project based on what is currently in my feature checkout, while the the support checkout should remain a copy of what is currently live.

How can I create a new branch with the current code I have, and once I have, how to I go about moving changes from one to the other (both from support/live -> feature and vice versa)?


You can create branches right from a working copy. Go to the feature working copy and:

svn copy c:\featureWC http://server/svn/repos/branches/MyNewFeature

Don't forget to switch afterwards:

svn switch c:\featureWC http://server/svn/repos/branches/MyNewFeature


I would make a branch from the rev you checked out, and then apply your changes from your checkout to the new branch checkout


To checking existing working copy changes to a new branch:

  1. Start in the base of your working copy

    cd /your/working_copy_dir

  2. Look at the current base revision your support branch is checked out from

    svn info your_working_directory

  3. Create a branch in svn

    svn copy repourl/trunk@checked_out_revision repourl/branches/supportversion

  4. Switch your support working copy to the new branch

    svn switch repourl/branches/supportversion

  5. Check in your changes to new support branch

    svn commit

To merge changes between branches:

svn merge ...

But you owe it to yourself to checkout a distributed version control system. This is a good read that applies to git/hg/bzr, etc: http://hginit.com

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜