可以连贯地管理多个存储库吗? [英] Is it possible to manage multiple repositories coherently?

查看:132
本文介绍了可以连贯地管理多个存储库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拥有一组独立版本但相互关联的git存储库。例如,添加一个功能时,我可能需要向共享库添加功能,然后扩展应用程序或服务以利用该功能。



目前,我将不得不在创建该功能时触摸的每个存储库上创建一个分支。然而,我想要做的是通过一次性分支和合并这些多个存储库来简化流程(以减少忘记分支或在一个存储库中提交/合并而不是另一个存储库的可能性)。

b
$ b

是否有一种简单的方法可以一次分支和合并多个存储库,或者这是一个更适合于辅助脚本集合的任务吗?如果是后者,是否有可用的脚本已经完成了这项工作? 解决方案

没有内置的交易方式同时拥有多个存储库,如果您考虑git的分布式特性,那么 可以定义它,但实际上没有其他任何东西。 (考虑一下,如果某人在一个存储库中从你那里获得了某个数据,但是又有另一个数据存储 - 那么你是否能够保持这种一致性?)

您可能会发现一个工具,如 mr ,它可以同时在多个存储库中使用,很有帮助。



然而,如果你真的有那么紧密的东西,我会建议你把它们放到一个存储库中。这样你就不能忘记任何步骤,因为它们发生在一个原子操作中。



如果你的代码实际上并不紧密地绑在一起,放弃完全一致的分支概念,你会更开心。


I have a collection of git repositories that are independently versioned but related to one another. For example, when adding a feature I may have to add functionality to a shared library, and then extend an application or service to take advantage of that functionality.

Currently, I would have to create a branch on each of the repositories that I touch while working on that feature. What I would like to do, however, is to simplify the process by branching and merging those multiple repositories at once (to reduce the likelihood of forgetting to branch, or committing/merging in one repository but not another).

Is there a simple way to branch and merge multiple repositories at once, or is this a task better suited for a collection of helper scripts? If the latter, are there any scripts available that already accomplish this?

解决方案

There isn't a built-in way to deal with multiple repositories at once, and if you think about the distributed nature of git, there really isn't anything but social convention that can define that. (Consider, what if someone pulls from you in one repository, but another remote for the second - can you have this coherence?)

You might find a tool like mr, which works with multiple repositories at the same time, helpful.

If you really have things that are tied that tightly, though, I would advise you to put them into one repository. That way you can't forget any of the steps, because they happen in one atomic operation.

If your code isn't actually that tightly tied together, though, then give up the "must branch at exactly the same time" notion and you will be happier.

这篇关于可以连贯地管理多个存储库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆