38

I am currently using TortoiseSVN to manage a couple of the projects that I have on the go at the moment. When I first moved everything into source control I wasn't really sure how everything should be laid out so I ended up putting each project into its own repository.

I was wondering would it be a good idea for me just to move them all into one big repository and have them split into project folders? What does everyone else do?

At the moment none of them share common code but they may in the future. Would it make it easier to manage if they where all together.

Thanks.

roalz
  • 2,699
  • 3
  • 25
  • 42
Nathan W
  • 54,475
  • 27
  • 99
  • 146
  • Could someone with sufficient reputation rename the topic to something like "Source control: Store all projects in a single repository?" Current title is misleading. – Suma Sep 26 '08 at 11:29

11 Answers11

31

Depends to an extent what you mean by "project".

I have a general local repository containing random bits of stuff that I write (including my website, since it's small). A single-user local SVN repository is not going to suffer noticeable performance issues until you've spent a lot of years typing. By which time SVN will be faster anyway. So I've yet to regret having thrown everything in one repository, even though some of the stuff in there is completely unrelated other than that I wrote it all.

If a "project" means "an assignment from class", or "the scripts I use to drive my TiVo", or "my progress in learning a new language", then creating a repos per project seems a bit unnecessary to me. Then again, it doesn't cost anything either. So I guess I'd say don't change what you're doing. Unless you really want the experience of re-organising repositories, in which case do change what you're doing :-)

However, if by "project" you mean a 'real' software project, with public access to the repository, then I think separate repos per project is what makes sense: partly because it divides things cleanly and each project scales independently, but also because it's what people will expect to see.

Sharing code between separate repositories is less of an issue than you might think, since svn has the rather lovely "svn:externals" feature. This lets you point a directory of your repository at a directory in another repository, and check that stuff out automatically along with your stuff. See, as always, the SVN book for details.

Steve Jessop
  • 273,490
  • 39
  • 460
  • 699
8

I would store them in the same repository. It's kind of neater. Plus why would it matter for continuous integration and such - you can always pull a specific folder from the repository.

It's also easier to administer - accounts to one repository, access logs of one repository etc.

Svet
  • 3,555
  • 8
  • 28
  • 23
  • 1
    In my CI setup I tag builds with the revision number that is exported from the repository. It's very easy to go back and find the exact state of a project, but this requires separate repositories. – Jonny Apr 28 '15 at 00:59
7

My rule of thumb is to consolidate things that are delivered together. In other words, if you might deliver project X and project Y separately, then put them in separate repos.

Yes, sometimes this means you have a huge repo for a project that contains a huge number of components, but people can operate on sub-trees of a repo and this forces them to think of the "whole project" when they commit changes to the repo.

andy
  • 6,888
  • 1
  • 19
  • 17
5

I would absolutely keep each project in its own repository, separate from all others. This will give each project its own history of commits. Rollbacks on one project will not affect other projects.

Steve Paulo
  • 17,954
  • 2
  • 23
  • 23
  • 3
    If you keep your projects in separate directories in a single repository, then each project would still have its own history of commits. – Dima Sep 24 '08 at 23:05
  • 3
    Rolling back a change can be done at pretty much any granularity level. There's generally no reason for it to be done at the repository level. Changelogs can likewise be accessed at a directory level. You will be dealing with directories (branches) even if you have one project per repository. – Derek Park Sep 24 '08 at 23:33
4

Personally I prefer each project in it's own repository

paan
  • 7,054
  • 8
  • 38
  • 44
3

If you work with a lot of other people you might consider whether everyone needs the same level of access to every project. I think it is easier to give access rights per person if you put each project in a separate repository. ~~~

Steve Pitchers
  • 7,088
  • 5
  • 41
  • 41
2

If you're going with a separate repository for each project, you might use the External tag to refer to other repositories -thus share code.

Silver Dragon
  • 5,480
  • 6
  • 41
  • 73
1

If your projects are independent, it's fine to keep them in separate repositories. If they share components, then put them together.

Dima
  • 38,860
  • 14
  • 75
  • 115
0

As long as each project has /trunk /tags and /branches you're good. Proper continuous integration is the criterion here.

Matt Hinze
  • 13,577
  • 3
  • 35
  • 40
0

Yes, put everything in source control.

If you're using SVN, keep projects in their own repository - svn is slow, and gets slower.

Marcin
  • 48,559
  • 18
  • 128
  • 201
  • While Subversion might be a bit slow, I've certainly not noticed it slow down with the kinds of load a personal project would be remotely likely to inflict; the added administrative overhead of multiple repositories would be much more annoying. – Nicholas Riley Sep 24 '08 at 23:02
  • I've noticed 1000+ revisions do cause a minute or so of processing, so it depends on how many check-ins there will be and how long the repository will be around. – Cees Timmerman Feb 03 '14 at 14:07
0

For Subversion, I'd suggest putting everything in the same repository; the administrative overhead of setting up a new repository is too high to make it a no-brainer, so you're more likely not to version something and regret it later. Subversion provides plenty of fine-grained access controls if you need to restrict access to a portion of your repository.

As I begin to migrate my projects to Mercurial, however, I've switched to creating a repository per project, because it just takes a "hg init" to create a new one in place, and I can use the hg forest extension to easily perform operations on nested repositories. Subversion has svn:externals, which are somewhat similar, but require more administrative overhead.

Nicholas Riley
  • 43,532
  • 6
  • 101
  • 124
  • 2
    I was going to say that, but then it occurred to me that maybe not everybody uses just local repositories for their own stuff. If you plan to set up a web interface, and access restrictions, and so on, for each repository, then it's more than no work. Although I imagine it's scriptable. – Steve Jessop Sep 24 '08 at 23:27
  • 1
    Yeah, that's what I meant - repositories that aren't network accessible aren't terribly useful to me as I work from at least 5 machines every day. (I realize I'm probably in the minority that way). – Nicholas Riley Sep 25 '08 at 06:25