gpt4 book ai didi

git - 使用具有许多子模块的项目实现 git 流的最佳方法是什么

转载 作者:行者123 更新时间:2023-12-04 02:49:48 26 4
gpt4 key购买 nike

我们搭建了一个Asp.net core微服务项目,并将代码组织成一个 super 项目和多个Git子模块(每个微服务是一个子模块)。现在我们要开始使用 Git Flow 工作流程。

初始化 gitflow 的最佳方式是什么?我们是否需要每个子模块有一个 git 流,或者我们应该在 super 项目级别有一个全局 git 流?

谢谢!

最佳答案

类似 readium/readium-js-viewer 的项目(使用子模块)考虑使用 git flow 并在 issues 392 中进行了讨论.

使用 git flow 会涉及将每个命令分解成它们的 Git 等价物,用作:

git submodule foreach —recursive 'git checkout develop'

但是(在本文档中):

However, this workflow has turned out to be somewhat problematic for several reasons.

  • The git-flow tools (which are essentially bash scripts calling command line git routines) have a number of bugs.
    Most importantly, if there are any problems with the merge or release process, the bash scripts simply fail silently - appearing to work when in fact they do not and often report success when this is not true.
  • Git, in general, is somewhat fragile with respect to the use of submodules. For example, if the structure of a submodule changes (e.g. the folder structure changes) then merges and new branch creation can fail as git doesn’t know how to correctly delete obsolete branch fragments.
    The abandoned fragments need to be deleted manually.
  • The git-flow workflow seems to be overkill for our relatively small project (compared to, for example, Adobe’s Creative Suite, Eclipse and other large projects).
    The general purpose of a release branch workflow is to test and merge a complex project. If problems are found they can be fixed and the result pushed back to develop.
    In practice, we rarely encounter problems in the RC branch sufficiently severe to resolve in place and re-merge. Instead, we simply log an issue and plan to fix it in the next release.

So the use of the full git-flow workflow - both the tools and the workflow itself - do not seem the best fit for Readium.
In consequence, we propose that Readium adopt a workflow similar to git-flow, but simplified to suit our need

因此,使用分支可以通过 git submodule foreach —recursive 来完成,...但您可能希望让所述分支工作流程尽可能简单。


或者,OP Nabil Kem添加 in a comment :

I finally ended up removing the sub-modules as they generated more issues than benefits.

关于git - 使用具有许多子模块的项目实现 git 流的最佳方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55583688/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com