Steffen Nieuwenhoven
Steffen Nieuwenhoven

Reputation: 525

Create Trunk/Branch&Tag structure after first commits

We have a svn server sucesfully running since a couple of years. We structure everything in one repository, with the structure:

--Project 1
  --trunk
    --source
  --branch
  --tag
--Project 2
  --trunk
  --branch
  --tag

Unfortunately, somebody created a project without the trunk/branch/tag structure. So now we have

--Project 1
  --trunk
    --source
  --branch
  --tag
--Project 2
  --trunk
  --branch
  --tag
--Project 3
  --source

What would be the preferred way, to move the folders into the right folder structure, without losing the file history (quite some commits were already done on project 3). We're using svn plugin within eclipse, but Tortoise or commandline is also fine.

I appreciate any help!

Upvotes: 0

Views: 128

Answers (1)

gehho
gehho

Reputation: 9248

You can simply create the trunk, tags, and branches folders and move the existing source folder into the trunk folder.

Here are two ways how you can achieve this:

  • Using the Repository Browser in Tortoise SVN:
    • Open the Repository Browser and browse to your "Project 3" folder.
    • Create the trunk folder.
    • Move the source folder into the trunk folder by dragging it onto the trunk folder.
    • Note that this will create multiple revisions: one for creating each folder, and another one for moving the folder.
  • Using your local working copy:
    • Create the trunk, tags, and branches folders locally.
    • Add the folders to Subversion.
    • Commit the folders to the repository (it is safer to commit the folders before moving the source folder into the trunk).
    • Right-click the source folder and drag it with the right mouse button still pressed onto the new trunk folder.
    • In the context menu select "SVN Move versioned item(s) here".
    • Note: It is important to use "SVN Move" (using right-button-drag) and not the normal move from Windows Explorer (using left-button-drag) because otherwise your SVN history will be lost!

Upvotes: 2

Related Questions