Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 620
John Avatar asked May 18 '10 08:05

John


People also ask

How do I create a branch in svn trunk?

To create a branch or a tag in a Subversion repository, do the following: From the main menu, choose VCS | Subversion | Branch or Tag. Alternatively, select the source folder in the SVN Repositories tool window and choose the Branch or Tag command from the context menu.

How do I commit a change to a new branch in svn?

In order to do that, you only need to follow three steps: Create a new branch in which you will commit your changes. Switch your current working copy to this new branch. Commit your changes to the new branch.

What is the difference between trunk and branch in svn?

The trunk is the main line of development in a SVN repository. A branch is a side-line of development created to make larger, experimental or disrupting work without annoying users of the trunk version.

Which is the command used to create branches svn?

Creating a branch is simple. All you need to do is make a copy of your project using "svn copy". This command will require the URL of your project's /trunk directory as well as the URL of the directory where you want to create your branch.


2 Answers

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

like image 86
Midhat Avatar answered Sep 17 '22 17:09

Midhat


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

like image 31
ryanprayogo Avatar answered Sep 21 '22 17:09

ryanprayogo