English 中文(简体)
吉唐-独立分局或对同一方案使用略有不同的情况进行不同
原标题:Git - Independent Branches or Different repos for instances of the same program with slightly different use

我最近开始使用it,并有一个问题。 我有两个方案分支,一个使用算法A,另一个使用算法B。 这些算法是不同的。 现在,对于这两个部门中的每一部门,我想对不同类型的数据(这些数据可能多达50个不同案例)的方案提出不同的例子。 在你提出要求之前,由于复杂和业绩问题,我不得不将所有这些内容纳入同一方案。

Additionally, if possible, I would like to be able to modify the core (i.e. the part of the source that is shared between all instances) and all instances to be updated with the change.

What method would you recommend to achieve that?

PS:由于我的问题可能并不明确,因此感到可以要求得到任何补充资料。

最佳回答

If they do the same thing differently, try to make them conform to a common interface/API. If you can do that, then apply the Bridge pattern The two implementations can just live in different subdirectories. You don t really need git or branches do manage this--just have two different implementations of behind the Bridge and choose the correct impl at runtime (or compile-time, as it seems you prefer the compile-time approach).

问题回答

你可以拥有一个拥有核心代码的主子,还有2个与alg和alg B的分支,以便你把主子并入算法的分行。 这样,你就可以有两种不同的方案,它们具有不同的算法,但具有相同的核心。 我真心实意地理解你有时意味着什么。





相关问题
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 ...

热门标签