SVN:为每个项目创建一个新的存储库还是将所有项目放入主干?
我们基本上有两个项目,这两个主要项目中的每一个都有由它们组成的子项目。目前,我们在 SVN 中拥有 1 个这样的存储库:
/SVN-REPO1/MainProj1/
-trunk
-branches
-tags
我应该完全创建一个全新的存储库,然后将 MainProj2
放入其自己的存储库中吗? 或者我应该将MainProj2
放在SVNREPO1
内部吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
无论哪种方式都有效,但我发现在公司开发团队中工作时,使用第二种方法更容易(将 MainProj2 放入 SVNREPO1)。我这样说是因为更容易告诉新员工事情的进展情况,而且每个人只需去一个地方即可获取来源。唯一的缺点可能是您的存储库可能会变得非常大,并且您的初始下载可能需要相当长的时间。没有说您必须立即下载整个内容,但如果您不打算这样做,您也可以拥有单独的存储库。
Either way works, but I find that when working within a corporate development team it is easier to use the second approach (put MainProj2 inside SVNREPO1). I say this because it is easier to tell new hires where things are at and everybody only has to go to one place to get the source. The only drawback may be that your repo could become very large and your initial download of it could take quite awhile. Nothing saying that you have to download the whole thing at once, but if you aren't going to do that you might as well have separate repos.
我认为这取决于 MainProj1 和 MainProj2 之间的关系。如果它们非常相关,则使用相同的存储库。
为每个项目创建不同的存储库可以方便地独立跟踪历史记录、合并和分支。如果两个项目都在同一个存储库中,您仍然可以这样做,但是将它们放在不同的存储库中只会让事情变得更简单。
还要考虑可维护性。随着项目的增长,维护这个包含两个主项目和子项目的存储库可能会变得更加复杂。
除非两个项目彼此非常相关,否则我会选择单独的存储库。
I think it depends on the relation between MainProj1 and MainProj2. If they are very related, then use the same repo.
Creating a different repo for each project is handy for tracking history, merging and branching independently. You can still do it if both projects are in the same repo, but having them on different repos just makes it simpler.
Think of maintainability too. Maintaining this repository, with two main projects with sub projects, could become more complex as the projects grow.
Unless both projects were very related to each other, I would go for separate repositories.
您现在需要知道,如果您使用相同的存储库,所有项目的修订号都会增加。这使得仅通过最新修订号来快速了解项目中是否有新提交变得更加困难。
如果您授予对单个存储库的访问权限,您需要确保通过子文件夹(每个项目)进行限制,这很容易出错。
这就是为什么我为每个项目创建一个存储库的原因。对于项目之间的链接,很容易设置将显示关系的外部。
互连良好的较小单元通常更易于管理。如果您有一个好的项目管理软件,那么存储库的创建和访问权限的管理就很容易。检查 Svn Access Manager 或 Indefero,他们做得很好。
You need to now that if you use the same repository, the revision number will increase for all the projects. This makes harder to quickly know if there are new commits in your project by just following the latest revision number.
If you give access rights to your single repository you need to ensure that you limit by subfolder (each project) this is error prone.
This is why I create one repository per project. For the links between projects, it is easy to setup externals which are going to show the relationship.
Smaller units well interconnected are often easier to manage. If you have a good project management software, the creation of the repositories and the management of the access rights is easy. Check Svn Access Manager or Indefero, they do it well.