我应该将所有项目存储在一个存储库中还是多个存储库中? [英] Should I store all projects in one repository or multiple?

查看:50
本文介绍了我应该将所有项目存储在一个存储库中还是多个存储库中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用 TortoiseSVN 来管理我目前正在进行的几个项目.当我第一次将所有内容移到源代码控制中时,我并不确定应该如何布置所有内容,因此我最终将每个项目都放入了自己的存储库中.

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.

谢谢.

推荐答案

在一定程度上取决于项目"的含义.

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

我有一个通用的本地存储库,其中包含我编写的随机内容(包括我的网站,因为它很小).单用户本地 SVN 存储库不会遇到明显的性能问题,除非您花费了很多年的时间打字.无论如何,到那时SVN会更快.所以我还没有后悔把所有东西都放在一个存储库中,即使那里的一些东西除了我写的之外完全不相关.

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.

如果项目"的意思是课堂作业",或者我用来驱动 TiVo 的脚本",或者我学习新语言的进展",那么为每个项目创建一个 repos 似乎有点不必要我.再说一次,它也不需要任何费用.所以我想我会说不要改变你正在做的事情.除非你真的想要重新组织存储库的经验,在这种情况下改变你正在做的事情:-)

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.

在不同的存储库之间共享代码比您想象的要少,因为 svn 具有相当可爱的svn:externals"功能.这使您可以将存储库的目录指向另一个存储库中的目录,并自动将这些内容与您的内容一起检出.与往常一样,请参阅 SVN 手册以了解详细信息.

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.

这篇关于我应该将所有项目存储在一个存储库中还是多个存储库中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆