从特定的回购散列或标签创建一个git子模块 [英] Create a git submodule from a specific repo hash or tag

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

问题描述

我有一个依赖于Twitter bootstrap 2.x的项目,但是,当我使用以下命令将引导添加为子模块时:

I have a project which depends on Twitter bootstrap 2.x, however, when I add bootstrap as a submodule using the following:

git submodule add https://github.com/twbs/bootstrap.git

这会带来在最新版本的引导程序中。

This brings in the latest version of bootstrap.

我想为特定标记创建子模块,但尚未找到实现该模块的方法。这是可能的吗?

I would like to create a submodule for a specific tag, but haven't found a way to do that. Is this possible?

推荐答案

创建子模块后:

Once your submodule is created:

cd /path/to/yoursubmodule
git checkout yourTag
cd ..
git add yoursubmodule
git commit -m "use submoduile at tag xx"
git push

您以这种方式记录您希望某个子模块处于某个特定标记。

You records that way the fact you want a submodule at a certain tag.

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

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