1

1.Repository文件夹结构:

- 存储库根
   -- ASP.NET MVC4 项目文件夹    
      --- 视图和控制器
          ---- 索引、登录、仪表板、常用样式和脚本
      --- 领域
          ---- 1区
          ---- 区域 2

2.条件

  • 鉴于 3 个项目(仪表板,区域 1-2)几乎是独立开发的,因为它们是共享相同数据库和一些业务逻辑的独立工具。

  • 区域共享根项目的一些样式、模板和脚本

  • 项目的发布日期不同,每个项目都应该能够单独部署,而不影响其他项目。

3.问题

如何组织 git 分支方案以满足条件

区域使用的必要性(而不是单独的 asp.net mvc 项目或一个项目中的简单子文件夹)不是问题,我们确实需要这样。


到目前为止,我最好的想法是像这样组织分支机构:

- 发布 //当前发布的分支,修复在这里
 - Master //下一个候选版本
 -dev //当前聚合开发版本
 -- Dashboard //在根项目上工作到这里
 -- 区域 1 //在区域 1 上工作到这里
 -- 区域 2 //在区域 2 上工作到这里
  • 仪表板和区域仅从中提取更新Master
  • 仪表板和区域推送更新Dev以测试集成解决方案。
  • Master仪表板和区域会在被证明已为下一个版本做好准备时推送更新。

branch sync scheme

但是这个解决方案有一些不完整和可疑的气味。

4

2 回答 2

1
  • Given 3 projects (Dashboard, Area 1-2) are being developed almost independently as they are separate tools sharing same database and some of business logic.

  • Release dates of projects are different, every project should be able to be deployed separately keeping others untouched.

You've got the answer in your question: those are three different projects. Each project should have its own repository. Branching is not meant for this kind of workflow and I'm afraid, using them to manage separate projects in one repo will be a pain.

Create a repo for each of those projects and a fourth repo for your whole application. Add those three projects as submodules. This way you'll be able to manage the subprojects separately and also freeze combinations of their states as releases of your larger project.

于 2013-06-11T08:06:34.393 回答
1

Ended up doing it like this: enter image description here

With git's ability to pull/push to/from different remote branches we can keep our current permanent feature branch checked out and sync with remote DEV branch easily.

Works perfectly.

于 2013-07-04T11:25:47.883 回答