Create SVN branch from changes in trunk
Asked Answered
A

4

6

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 transfer 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.

Antebellum answered 18/5, 2010 at 8:54 Comment(0)
A
13

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

Aestivation answered 18/5, 2010 at 8:58 Comment(4)
Do you mean Branch/Tag? But how could the default Link to the working copy be changed?Antebellum
You can switch after that. Your changes will be committed to the new branch and there is no problem with switch. You will lose noithingAestivation
In TortoiseSVN click Branch/Tag and then instead of selecting the HEAD or specific revision choose the working copy radio button. That is what Midhat is talking about.Bootless
@Biran thanks for the explanation. Yes thats what I am talking abtAestivation
B
9

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

Baur answered 18/5, 2010 at 13:44 Comment(1)
Nice clear explanation! (2) could use an example command "svn switch <new branch URL>"Leonleona
S
0

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.

Strophe answered 18/5, 2010 at 8:58 Comment(2)
Thanks, I'll try my hand with this method.Antebellum
It seems this answer was downvoted (though it has a score of 0, I can see it in my Reputation settings). Can anyone tell me why?Strophe
S
0

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

Staves answered 2/5, 2013 at 18:56 Comment(2)
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.Hystero
I think my answer is very relevant to the question.Staves

© 2022 - 2024 — McMap. All rights reserved.