使用特定提交号添加git子模块

问题描述 投票:0回答:1

我正在使用git子模块命令在项目中添加this FSM repo。我想签出特定的发布提交。默认情况下,主分支被检出。添加git repo后,当我运行时

$ git submodule

它给出

d1b66d66cfa95f238a7498465908a262f4b2326a directory_path/fsmlite

此处的提交编号属于master分支提交。如何使用其提交号签出另一个提交?

git-submodules
1个回答
0
投票

可能还有其他方法,但是我得到了所需的提交者

$ cd directory_path/fsmlite 
$ git checkout v0.7.1      (this is the branch I wanted to point to)
$ git submodule update
$ cd parent_dir
$ git submodule 

  +de19ea0a71cb6082fe9311694a27e8f0cc2f972a directory_path/fsmlite (v0.7.1)

这是我想要的具体提交编号

© www.soinside.com 2019 - 2024. All rights reserved.