Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy a Project in SVN

Tags:

svn

I am new to SVN, and I am trying to copy an existing project(just the trunk) and create a new project in the same repository. We are creating the same application for a different audience, so I would like to copy the existing code base and create this new code base. I didn't want to branch/tag as these are going to be completely different projects from now onwards - and I am not interested in preserving the history etc.,

This is what I was planning to do, but this looks like lot of Checkout/Commit, so wondering is there any other simple way.

  1. Export the trunk of existing project (lets say 'Project1') from SVN to my new project(lets say Project2) folder at C:\inetpub\wwwroot\Project2
  2. Create a new project in SVN called 'Project2' and import all the files from my C:\inetpub\wwwroot\Project2 to its trunk
  3. Again Checkout from SVN's Project2 to my local machine(C:\inetpub\wwwroot\Project2 folder)

The Project1 folder is huge(~400 mb), so this would take a long time. Is there any other alternate?

I am able to right click on the trunk folder of Project1 in Tortoise SVN's repo browser and choose 'Copy to' and specify Project2's trunk folder, and it copied all the files. This way I just have to checkout once to my machine and everything is ready.

But I am not sure about whether it is right or the consequences behind it. Any help would be appreciated.

like image 713
kthiagar Avatar asked Nov 19 '09 20:11

kthiagar


People also ask

How do I clone a project in svn?

# Clone a repo with standard SVN directory layout (like git clone): git svn clone http://svn.example.com/project --stdlayout --prefix svn/ # Or, if the repo uses a non-standard directory layout: git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ # View all branches and tags you have ...

What is working copy in svn?

Working copies A Subversion working copy is your own private working area, which looks like any other ordinary directory on your system. It contains a COPY of those files which you will have been editing on the website. You can edit these files however you wish, in the usual way.

How do I export a project from svn repository?

In the main menu, select VCS | Browse VCS Repository | Browse Subversion Repository to open the SVN Repositories tool window. Right-click a directory you want to export and choose Export from the context menu. In the Select Path dialog that opens, specify the destination directory and click OK.


2 Answers

A branch or a tag in subversion is basically a copy operation anyways, it just goes into a different folder by convention.

You can simply use svn copy

It's a quick and simple way, especially if you have a large repo. You will preserve history, but this is a good thing.

like image 95
Philip Reynolds Avatar answered Sep 21 '22 17:09

Philip Reynolds


svn cp http://yoursvnserver/svn/Project1 http://yoursvnserver/svn/Project2

like image 24
leeeroy Avatar answered Sep 18 '22 17:09

leeeroy