如何粘贴一个子模块来修复一个标签? [英] How to stick a submodule to a fix a tag?

查看:140
本文介绍了如何粘贴一个子模块来修复一个标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我们有两个模块 super minor 。模块超级取决于模块 的版本 v1.0.3 ,而 v1.0.3 minor 上的注释标签:

Assume we have two modules super and minor. Module super depends on version v1.0.3 of module minor, whereas v1.0.3 is an annotated tag on minor:

        v1.0.3
super <-------- minor

模块 minor 是一种私有,即只有一小部分开发人员具有写访问权限,而其他只有读访问权限。模块 super 是公开的。

Module minor is kind of "private", i.e. only a very small group of developers has write access and others only have read access. Module super is public.

现在我想模拟 super使用Git子模块到模块 minor 。不幸的是,我不知道如何解决依赖关系到 v1.0.3

Now I would like to model the dependency of module super to module minor utilizing Git submodules. Unfortunately I can't figure out how to fix the dependency to v1.0.3.

此外,我会也就像---稍后的一段时间---将依赖关系固定在另一个版本上。

In addition, I would also like --- some time in future --- to fix the dependency to another version.

在所有情况下,我想要有
..所有开发人员自动以正确的版本检索模块 minor
...所有开发人员---但上述小组---不允许修改此依赖关系(而这是一个小问题)

In all cases I would like to have that ... all developers "automatically" retrieve the module minor in the correct version. ... all developers --- but the afore mentioned small group --- are not allowed to modify this dependency (whereas this is a minor issue)

任何想法?

Cheers,
/ nm

Cheers, /nm

推荐答案

p>首先,子模块引用提交(SHA1),所以记住正确的SHA1的最简单的方法是进入你的子模块,只需要 git checkout v1.0.3 ,然后返回到您的父级repo,提交并推送新的状态:由于标记与提交关联,您将推动您的子模块与该标记相关联的事实。

当您的同一过程可以重复要调整相同子模块的标签。

First, submodules reference commits (SHA1), so the simplest way to memorize the right SHA1 is to go in your submodule and simply git checkout v1.0.3, then go back to your parent repo, commit and push that new state: since a tag is associated to a commit, you will push the fact that your submodule is associated with that tag.
The same process can be repeated when you want to adjust the tag of that same submodule.

关于修改该子模块的权利,一种控制方法是添加一个授权框架 gitolite

Regarding the right to modify that submodule, one way to control that is to add an authorization framework on your Git server: gitolite.

这篇关于如何粘贴一个子模块来修复一个标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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