Git:如何创建一个也包含子模块的标签? [英] Git: How to create a tag that also include submodules?

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

问题描述

我得到了一个包含许多子模块的项目,我刚刚发布了一个版本,并且我想标记这一切。



我想创建一个可以在其中签出的点未来,它将包括我的项目的当前代码以及所有子模块的所有当前代码。 当您为代码添加标签时一个提交,您 标记该提交正在使用的子模块的版本。



当您使用子模块时,您的提交包含代码当前正在使用的子模块中提交的SHA。当您更新子模块中的代码时,您会看到您在超级项目中提交了更改(新的SHA)。所以,标签自然会以您想要的方式工作。


I got a project with many submodules, I just made a release and I want to tag it all.

I want to create a point where I can checkout in the future and it will include the current code of my project along with all the current code of all submodules.

解决方案

When you tag a commit, you are tagging the version of your submodules that is being used by that commit.

When you use a submodule, your commit includes the SHA of the commit in the submodule that your code is currently using. When you update the code in your submodule, you will see that you have changes to commit (the new SHA) in the super project. So, a tag will naturally work the way you want.

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

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