English 中文(简体)
具有竞争力的项目结构
原标题:Efficient project architecture with git

首先,请允许我介绍项目的一般结构。

它是等级的。 我们为客户开发服务器应用程序。 储存在<>主要服务器。

Say, Local Service 1, local services 2, ..., local services n are theuser (main application cases). 每个公司都有一个当地服务器。 大部分地方服务器都有同样的功能(例如,核心模块),但每个公司都有自己的。 作为一项想法,决定通过git Branching解决这一问题。

请允许我审议一些案件。

Case 1
One company (local server x) wants some specific feature that is needed only in that company. Following the logic our of idea of branches we do the following steps:

  1. create git branch on main server
  2. develop needed functionality for that server
  3. create git branch (branch y) on local server x
  4. push changes to main server
  5. switch branch y on local server x
  6. switch to master branch on main server

Case 2
We developed some functionality (changes in core module) that is common to all companies

Case 3
We developed some functionality that is common only to some companies

• 听取您关于如何处理“Case 2和“Case 3”的建议。

最佳回答

从技术上说,“VonC”是正确的,因为它说,分支机构是前进的道路。

但有一点点。 你在此重述了两个不同的模式。 SCM(git是一个工具)是指管理源代码及其不同版本。

有利/分散的产品特征是产品管理。 从根本上说,这阻碍了发展和部署你的申请。

你重新努力的是把产品的特殊管理与版本管理结合起来。

这当然是可行的(仅通过SCM),而且根据你的要求,它实际上可能为你工作。

然而,在一段时间内,你最终陷入分行/合并的 so。 不仅会增加时间和努力,维持和提升每个分支部门(并保留“主要”和其他“分支”,而且会适得其反,因为每次出现变化或新特点时,你会花更多的时间规划如何使各分支机构跟上实际情况。 随着时间的推移,新的雇用人员没有事先了解你的分支管理技术,如果你最终分配小组,他们可能出于各种原因想建立自己的分支,就更加复杂。

如果我可以建议,保留一个版本的您申请,并落实一个能够/可处置的“女性”机制。 这将使你的SCM更容易理解、更清洁地执行和维持。

中间点是核心模块的核心分支,然后每个分层或特征是其单独的分支。 任何人都可以安装核心单元,根据需要/需要,他们可以在各自的分支中单独安装和安装“名称”。

希望提供了一些清晰度。 如果你有任何问题,我很乐意阐述这些问题。

问题回答

我总体上同意奇福先生的意见。

Additionally I would like to mention that git branches are best used in one of these three situations:

  • Develop a feature on a separate branch and merge it into mainline when its done.
  • Maintain an older version with bug fixes or security fixes
  • Back port features of the current version to an older release

从长远来看,你要么计划把你的分支重新并入总务,要么停止。 长期以来,许多分支机构相互毗邻并非特别好的想法,因为它们会较早或更晚地与总务部门(以及相互之间)发生分歧,而且很难确保在所有分支部门适用ug或安全套。

The fact that we are talking about a core module with variations for the clients means git submodules isn t a valid solution here:
The same set of file is being modified (either for common feature, case 2, or for features for some clients, case 3).

So branches are a good way to deal with this, except you need to manage merges from one branch to multiple other ones.
For that, see questions like "How to move bugfixes across branches in DVCS?".





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签