用于每个Eclipse项目或一个Git存储库的多个Git存储库 [英] Multiple Git repositories for each Eclipse project or one Git repository

查看:158
本文介绍了用于每个Eclipse项目或一个Git存储库的多个Git存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从SVN转移到Git。在SVN中,我在单个SVN存储库中有多个eclipse项目,方便浏览项目。我将要移动到每个eclipse项目有一个git存储库,但是EGit建议不要这样做。



EGit 建议将多个项目放入单个Git存储库。



查看类似的问题这样建议每个存储库一个项目。



哪种方法是最佳做法,人们实施什么?

解决方案

这取决于这些项目的密切相关性。问自己以下问题:




  • 他们总是需要一起分支/标记吗?

  • 你想要承诺所有的项目,还是做承诺大多只是触摸一个项目?

  • 构建系统是否对所有项目进行操作? >


如果你把它们全部放在一起,上面的一些东西会更容易。您只需在一个存储库中分支/标记/存储/提交,而不是单独为每个存储库执行。



但是,如果您需要单独的项目发布周期,那么有必要让每个项目都在一个独立的存储库中。



请注意,您可以随时拆分存储库,或将多个存储库合并一个没有失去历史的人。



组合比分割更难做,所以我先去一个存储库,看看它是怎么回事。 b $ b

I am in the process of moving to Git from SVN. In SVN I had multiple eclipse projects in a single SVN repository that is convenient for browsing projects. I was going to move to having one git repository per eclipse project but EGit suggests doing otherwise.

The guide for EGit suggests putting multiple projects into a single Git repository.

Looking at similar questions such as this suggest one project per repository.

Which approach is best practice and what do people implement?

解决方案

It depends on how closely-related these projects are. Ask yourself the following questions:

  • Will they always need to be branched/tagged together?
  • Will you want to commit over all projects, or does a commit mostly only touch one project?
  • Does the build system operate on all of them or do they have a boundary there?

If you put them all in one, some things from above will be easier. You will only have to branch/tag/stash/commit in one repository, as opposed to doing it for every repository separately.

But if you need to have e.g. separate release cycles for the projects, then it's necessary to have each project in an independent repository.

Note that you can always split up a repository later, or combine multiple repositories into one again without losing history.

Combining is a bit harder to do than splitting, so I would go for one repository first and see how it goes.

这篇关于用于每个Eclipse项目或一个Git存储库的多个Git存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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