将git用于具有许多许多回购的项目

编程入门 行业动态 更新时间:2024-10-21 19:28:38
本文介绍了将git用于具有许多许多回购的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Plone项目由192个不同的回购项目组成: github/plone/

在开发过程中,有时需要触摸2或4或10个不同的回购站来修复错误或实现功能。如果所有这些可以分支在一起并合并在一起(例如,包含对 repo1 , repo2 和 repo3 )。

版本要求将整套repos分支并标记在一起。

Pre-git,一个版本是由一个文件定义的,该文件列出了组成该版本的所有模块的svn版本号。 git给了我们一个更简化的工作方式吗?

乍一看,似乎超级项目可能适用:

您可以更具体地定义项目与超级项目中的标签和分支之间的关系

progit/book/ch6-6。 html#superprojects Git / Submodules and Superprojects似乎证实了这一点,但仍然模糊(不涉及标签或分支)。 en.wikibooks/wiki/Git/Submodules_and_Superprojects

另一个听起来相关的工具是Joey Hess的 mr :

mr(1)命令可以检查,更新或对一组的仓库执行其他操作,就好像它们是一个组合仓库一样。

kitenet/~joey / code / mr / (我担心这会导致192个不同的分支碰巧具有相同的名称,而不是1个分支将所有回购联系在一起)。

这个问题看起来相关:是否有人真的使用git super /子项目?一个答案指出:

我们的项目(bitweaver,一个内容管理系统)是一个高度模块化的系统,有近160个仓库 - http:// github/bitweaver/。

听起来就像我们的情况。它引用了子模块的严重限制,并建议mercurial。听起来像 mr 可以帮助解决这些问题(在超级回购中执行所有目录中的git命令)。

解决方案

我会在全部回购中使用git子模块。另外,如果您发现跨越多个回购站的工作,请考虑git奴隶。这可以节省很多努力。

The Plone project consists of 192 different repos: github/plone/

During development, sometimes 2 or 4 or 10 different repos will need to be touched to fix a bug or implement a feature. It would be great if all these could be branched together and merged together (e.g. a pull request closing issueX containing commits to repo1, repo2 and repo3).

Releases require the entire set of repos to be branched and tagged together.

Pre-git, a release was defined by a file listing the svn revision numbers of all the modules that make up the release. Does git give us a more streamlined way to work?

At first glance, it seems like "Superprojects" might be applicable:

you can more specifically define the relationships between the projects with tags and branches in the superprojects

progit/book/ch6-6.html#superprojects "Git/Submodules and Superprojects" seems to confirm this, but remains vague (doesn't address tags or branches). en.wikibooks/wiki/Git/Submodules_and_Superprojects

Another tool that sounds relevant is Joey Hess's mr:

The mr(1) command can checkout, update, or perform other actions on a set of repositories as if they were one combined respository.

kitenet/~joey/code/mr/ (I would be concerned that this would result in 192 different branches that happen to have the same name, instead of 1 branch that ties together all the repos.)

This question looks relevant: Is anyone really using git super/subprojects? One answer states:

our project (bitweaver, a content management system) is a highly modular system, with nearly 160 repositories - github/bitweaver/".

That sounds like our case. It cites "severe limitations" with submodules and recommends mercurial. It sounds like mr could help to deal with those ("perform git commands to all directories in the super-repo").

解决方案

I would use git submodules in an "all" repo. Also, consider "git slave" if you find work spanning many repos. That can save a lot of effort.

更多推荐

将git用于具有许多许多回购的项目

本文发布于:2023-10-25 13:49:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1527134.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   git

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!