One SVN repository or many?

2019-01-08 02:59发布

If you have multiple, unrelated projects, is it a good idea to put them in the same repository?

myRepo/projectA/trunk
myRepo/projectA/tags
myRepo/projectA/branches
myRepo/projectB/trunk
myRepo/projectB/tags
myRepo/projectB/branches

or would you create new repositories for each?

myRepoA/trunk
myRepoA/tags
myRepoA/branches
myRepoB/trunk
myRepoB/tags
myRepoB/branches

What are the pros and cons of each? All that I can currently think of is that you get mixed revision numbers (so what?), and that you can't use svn:externals unless the repository is actually external. (i think?)

The reason I ask is because I'm considering consolidating my multiple repos into one, since my SVN host has started charging per repo.

标签: svn
13条回答
萌系小妹纸
2楼-- · 2019-01-08 03:53

We use a single repository. My only concern was scale, but after seeing ASF's repository (700k revisions and counting) I was pretty convinced performance would not be an issue.

Our projects are all related, different interlocking modules which form a set of dependencies for any given app. For this reason, a single repository is ideal. You may want seperate trunk/branches/tags for each project, but you're still able to atomically commit a change across your entire codebase within a single revision. This is awesome for refactoring.

查看更多
叛逆
3楼-- · 2019-01-08 03:54

My suggestion is one. Unless you have different users accessing each one, then I'd say use multiple.

But again, even that's not a good reason to use multiple.

查看更多
爱情/是我丢掉的垃圾
4楼-- · 2019-01-08 03:58

The single vs. multiple issue comes down to personal or organizational preference.

Management of multiple vs. single mainly comes down to access control and maintenance.

Access control for a single repository can be contained in a single file; Multiple repositories are may require multiple files. Maintenance has similar issues - one big backup, or a lot of little backups.

I manage my own. There's one repository, multiple projects, each with its own tags, trunk and branches. If one gets too big or I need to physically isolate a customer's code for their comfort, I can quickly and easily create a new repository.

I recently consulted with a relatively large firm on migrating multiple source code control systems to Subversion. They have ~50 projects, ranging from very small to enterprise applications and their corporate website. Their plan? Start with a single repository, migrate to multiple if necessary. The migration is almost complete and they're still on a single repository, no complaints or issues reported due to it being a single repository.

This isn't a binary, black & white issue.

Do what works for you - were I in your position, I'd combine projects into a single repository as fast as I could type the commands, because the cost would be a major consideration in my (very, very small) company.

JFTR:

revision numbers in Subversion really have no meaning outside the repository. If you need meaningful names for a revision, create a TAG

Commit messages are easily filtered by path in the repository, so reading only those related to a particular project is a trivial exercise.


Edit: See Blade's response for details on using a single authorization/authentication configuration for SVN.

查看更多
倾城 Initia
5楼-- · 2019-01-08 03:59

I would create separate repositories... Why? The revision numbers and commit messages will just not make any sense if you have a lot of unrelated projects in only one repository, it will be for sure a big mess in short term....

查看更多
叼着烟拽天下
6楼-- · 2019-01-08 03:59

Personally, I'd create new repositories for each. It keeps the check out process much simpler and makes administration on the whole easier, at least with regards to user access and backups. Also, it avoids the global version number problem, so the version number is meaningful on all projects.

Really though, you should just use git ;)

查看更多
Animai°情兽
7楼-- · 2019-01-08 04:00

We are a small software company and we use a single repo for all of our development. The tree looks like this:

/client/<clientname>/<project>/<trunk, branches, tags>

The idea was that we would have client and internal work in the same repo, but we ended up having our company as a "client" of itself.

This has worked really well for us, and we use Trac to interface to it. Revision numbers are across the whole repo and not specific to one project, but that doesn't phase us.

查看更多
登录 后发表回答