Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Folder structure for many projects in one SVN repository?

Tags:

repository

svn

I just created a Google Code SVN repository for storing my school projects and homework, and to allow easy transferring between school and home.

Its default directories it creates are:

https://simucal-projects.googlecode.com/svn/trunk/
https://simucal-projects.googlecode.com/svn/tags/
https://simucal-projects.googlecode.com/svn/branches/

I've never used a repository for more than one project, but after reading: One svn repository or many? I've decided to have a single repository for all of my random school projects.

Should I just replicate the folder structure above, but for each project?

https://simucal-projects.googlecode.com/svn/projectA/trunk/
https://simucal-projects.googlecode.com/svn/projectA/tags/
https://simucal-projects.googlecode.com/svn/projectA/branches/

https://simucal-projects.googlecode.com/svn/projectB/trunk/
https://simucal-projects.googlecode.com/svn/projectB/tags/
https://simucal-projects.googlecode.com/svn/projectB/branches/

Is this what you multi-project-in-one-repo people do?

like image 290
mmcdole Avatar asked Feb 21 '09 20:02

mmcdole


People also ask

Should you have a repository for each project?

From my experience, it is still better and sane to keep all your projects in one repository. With multiple repositories, you will end up managing many dump files and different user permission settings.

How do I create a folder in svn repository?

One way is to browse the repository to the place where you want to insert your new directory and right-click and select "Create Folder". Then right click the folder and check it out to the location where you want it. Then copy the directory of files you want to put into SVN into the folder created by the checkout.


1 Answers

You have two options for this. The one you already mentioned, and that is to have a trunk for each project (option 1):

https://simucal-projects.googlecode.com/svn/projectA/trunk/ https://simucal-projects.googlecode.com/svn/projectA/tags/ https://simucal-projects.googlecode.com/svn/projectA/branches/  https://simucal-projects.googlecode.com/svn/projectB/trunk/ https://simucal-projects.googlecode.com/svn/projectB/tags/ https://simucal-projects.googlecode.com/svn/projectB/branches/ 

Option 2 would be to have one trunk with each project being a subfolder under trunk:

https://simucal-projects.googlecode.com/svn/trunk/projectA/ https://simucal-projects.googlecode.com/svn/tags/projectA/ https://simucal-projects.googlecode.com/svn/branches/projectA/  https://simucal-projects.googlecode.com/svn/trunk/projectB/ https://simucal-projects.googlecode.com/svn/tags/projectB/ https://simucal-projects.googlecode.com/svn/branches/projectB/ 

The advantage of option 1 is that you can branch and tag each project independently. This is desirable if you need to deploy each project seperately.

Option 2 is desirable if all the projects are deployed together. This is because you only have to tag the repository once when deploying.

Since you are using Subversion for school projects, you need to ask yourself whether you will ever need to tag your work. You can also ask yourself whether you ever need to create branches (you probably would want to if you want to experiment a bit). You will also need to ask yourself whether you are happy to branch ALL your work together as one, of whether you prefer the flexibility of branching each project independently.

The rule of thumb that I always follow: trunk together whatever we deploy together.

(By the way - you can have many trunks in the same repository - this is almost equivalent to having one trunk in multiple repositories, except that each repository maintains its own revision counter and you cannot merge between repositories.)

like image 156
Sir Rippov the Maple Avatar answered Oct 04 '22 16:10

Sir Rippov the Maple