开发者

Create SVN branch from changes in trunk

I'm in a stupid situation: I have done some changes in a working copy of the TRUNK. Since the changes have not been tested, I'd like to tran开发者_Go百科sfer all the changes to a branch. According to the manual of Tortoise, Switch will lose all my modifications. Is there any way to keep my changes in the working copy and save them in a branch in the repository.


Create a branch from your working copy instead of the repository. That way you wont lose anyting


If I understand the problem correctly, you are working on a copy that you checked out off TRUNK, but you haven't committed the changes yet.

In that case, it's easy to solve this problem:

  1. Create a branch off TRUNK: svn cp <base URL> <new branch URL>
  2. Switch to the new branch (specified by <new branch URL> above)
  3. Now your working copy should point to the <new branch URL>
  4. Commit your changes

Since you haven't committed anything to TRUNK, the TRUNK version of the project is left unmodified


Not directly. But you can make a patch, then switch and lose your changes, then apply the patch to your branch.

Richt-click on your working copy top-most folder, choose Tortoise SVN > Create Patch. Choose the files to be included (usually all changes) and save it somewhere.

Then switch.

Then richt-click on the working copy again (which now points to the branch), and choose Tortoise SVN > Apply Patch. You'll get a menu where you can right-click and choose apply all. Save the changes and you should be good to go.


Create a patch of the changes and then apply it to any branch or working copy that you like.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜