mpen
mpen

Reputation: 282875

How to check in a second version of a project in a Subversion repo?

I have a project that I've checked into my SVN repo. Now I've created a second version of the project located in a different folder. I want to check this folder in as well, without interfering with the original project. Looking at my repo, it doesn't look as though I have the typical trunk/branches/tags folders, for whatever reason. So,

  1. How do I move the original project into a subfolder, like trunk?
  2. How can I create a folder for, and check all the v2 files into a new folder like branches/v2
  3. When I want v2 to replace the trunk completely, how can I do that?

SVN has caused me all sorts of nightmares in the past, so I want to make sure I do this correctly.

Upvotes: 1

Views: 97

Answers (2)

pmod
pmod

Reputation: 10997

How do I move the original project into a subfolder, like trunk?

  1. Check out the first repository to my_rep
  2. Create trunk, branches, tags sub folders in my_rep
  3. Copy files from my_rep to my_rep/trunk manually
  4. Delete files in my_rep (using svn delete!)
  5. Commit changes in my_rep - Now you have trunk

How can I create a folder for, and check all the v2 files into a new folder like branches/v2?

  1. Checkout the second repository to my_rep2
  2. Create folder my_rep/branches/v2 and copy manually files from my_rep2 there
  3. Commit my_rep - Now you have one branch in my_rep

When I want v2 to replace the trunk completely, how can I do that?

You need to merge my_rep/branches/v2 to my_rep/trunk using any diff tool.

Upvotes: 1

muksie
muksie

Reputation: 13053

You have to make the trunk/branches/tags folders yourself.

  1. svn mv original trunk (where original is your original code folder, you might have multiple files).
  2. Just create this new folder in your original checkout, and move the v2 files into it. Add them using svn add.
  3. Read about joining branches in the SVN book (or somewhere else) and join the v2 branch into trunk.

Upvotes: 1

Related Questions