Folder structure for many projects in one SVN repository?

前端 未结 6 1429
闹比i
闹比i 2021-01-31 03:14

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 i

相关标签:
6条回答
  • 2021-01-31 03:39

    There is no clear answer to this question as it depends on what suits your projects best.

    1. I would use /projectA/trunk layout if there was either a heavy development going on per project and everything needs to be separated since there is not that much connection between it (components/projects that stand alone). However, you could also use one SVN repository per project then. Remember you won't be able to check out all projects using svn co http://..../svn/ because this would also fetch all tags and branches from all projects, not only trunk.
    2. /trunk/projectA would certainly be better if your projects/components belong tightly together and you need to tag and branch them from the same revision (like a library belonging very closely to the main project). You can also use svn co http://.../svn/trunk/ to get all projects on their latest trunk revision if you like.

    From a maintainability point of view I would almost always prefer the second way; but if your projects get bigger and might prolong, it would be better to use separate repositories per project.

    Besides that: Please check if you really need Google Code services for your homework because its purpose is to support OSS. You can always use SVN locally or even through SSH, so you could also put your repositories on an USB stick or some computer that can be accessed remotely; you don't really need hosting for that. There could also be privacy concerns.

    0 讨论(0)
  • 2021-01-31 03:42

    That's what I use for my home source control.

    Where I only have one primary repository.

    Repository/Project1/Trunk
    Repository/Project1/Tags
    Repository/Project1/Branches

    Repository/Project2/Trunk
    Repository/Project2/Tags
    Repository/Project2/Branches

    I like this structure, it's very easy to reference projects and maintain integrity.

    0 讨论(0)
  • 2021-01-31 03:51

    A real-life example: The Apache Projects repository.

    0 讨论(0)
  • 2021-01-31 03:57

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

    0 讨论(0)
  • 2021-01-31 03:58

    One of main goals that tracks with folder lay-outing (in versioning), is Access Control Management.

    If there is need for separating Develop team ( who works on Trunk) and Maintain team (who dealing with Branches) this structure is good:

    /trunk
          /Project1
          /Project2
    /branches
             /Project1
             /Project2
    /tags
         /Project1
         /Project2
    

    And if we want to permit access of every project to a specific user group , this structure is good:

    /Project1
             /trunk
             /branches
             /tags
    /Project2
             /trunk
             /branches
             /tags
    
    0 讨论(0)
  • 2021-01-31 04:04

    If you insist on having just one repository (I'm in the DON'T camp myself) and do branching then I think what you propose is good. But again, I consider a SVN repository is equal to a project.

    0 讨论(0)
提交回复
热议问题