git - 从特定的 repo 哈希或标签创建一个 git 子模块

标签 git git-submodules

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

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

这会引入最新版本的 Bootstrap 。

我想为特定标签创建一个子模块,但还没有找到方法。这可能吗?

最佳答案

创建子模块后:

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

您以这种方式记录您想要某个标记处的子模块这一事实。

关于git - 从特定的 repo 哈希或标签创建一个 git 子模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18755933/

相关文章:

xcode - 移动到不同的 Mac 时,Git 子模块文件在 XCode 中显示为红色

git - Git 在哪里存储子模块提交的 SHA1?

git - 将克隆的 git 存储库转换为子模块

git - 如何将远程存储库添加到我自己的 git 存储库

git - 防止其他人强制推送到我的 Git 存储库

python - 在 gitpython 中获取特定文件的所有修订

eclipse - 克隆一个有子模块的 git repo

python - Conda 将一个 environment.yml 导入另一个

windows - Windows 上的 GIT 问题(文件名或扩展名太长)

git - 我可以与它的前辈之一压缩 merge 提交吗?