Folder structure for many projects in one SVN repository

repositorysvn

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?

Best Answer

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