用子模块创建一个git标签 [英] Create a git tag with submodule

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

问题描述



假设我有一个 projectA ,并且它有一个可能调用的子模块 moduleA

然后我在 projectA 中创建一个标签, , tagA ,那么我可能会为 projectA moduleA 也是,然后我想回到 tagA ,使用 git checkout tagA



问题是 projectA 回到 tagA ,但是 moduleA 不是。



你知道怎么做到吗? h2_lin>解决方案

只需更新您的子模块,即可回到父回购库中的 tagA

  git子模块更新




更新已注册的子模块,即克隆缺少的子模块并检出包含存储库索引中指定的提交。

与往常一样,子模块的结果回购将处于分离的HEAD模式。

请注意 projectA (带标签结帐)也会 处于分离的HEAD模式。



该标记引用父rpeo内容,包括 gitlink 索引中的特殊条目父回购),它指向子模块的特定SHA1。


Small question about git submodule.

Assume I have a projectA, and it have a submodule maybe called moduleA.

Then I create a tag in projectA, tagA, then I may have some new commits for projectA or moduleA also, and then I want to go back to the tagA, using git checkout tagA.

The problem is projectA go back to tagA, but moduleA not.

Do you know how can make this?

解决方案

Simply update your submodule one you go back to tagA in the parent repo:

git submodule update

Update the registered submodules, i.e. clone missing submodules and checkout the commit specified in the index of the containing repository.

As usual, the result repo of the submodule will be in a detached HEAD mode.
Note that projectA (with a checkout of a tag) will also be in a detached HEAD mode.

The tag reference the parent rpeo content, including the gitlink ( a special entry in the index of the parent repo) which points to a specific SHA1 of the submodule.

这篇关于用子模块创建一个git标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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