在project1中push之后其实就是更新了引用的commit id,然后project1-b在clone的时候获取到了submodule的commit id,然后当执行git submodule update的时候git就根据gitlink获取submodule的commit id,最后获取submodule的文件,所以clone之后不在任何分支上;但是master分支的commit id和HEAD保持一致。 查看~/submd/ws/project1...
例如,git clone –depth=<版本数> <远程仓库URL>。使用–depth参数可以减少克隆所需的时间和磁盘空间,但是会丢失部分历史记录。 6. 克隆子模块:如果远程仓库中包含子模块,可以使用–recurse-submodules参数同时克隆子模块。例如,git clone –recurse-submodules <远程仓库URL>。 7. 克隆速度优化:git clone命令支持...
After the clone is created, initialize and clone submodules within based on the provided<pathspec>. If no=<pathspec>is provided, all submodules are initialized and cloned. This option can be given multiple times for pathspecs consisting of multiple entries. The resulting clone hassubmodule.active...
5. 克隆子模块:git clone –recurse-submodules <远程仓库地址> <本地目录> 添加”–recurse-submodules”参数可以克隆子模块(仓库中嵌套的其他仓库)。 除了上述常用参数外,git clone还有其他一些可选参数可以根据实际需求进行使用,具体的参数可以通过”git help clone”命令查看详细文档。 git clone命令是Git版本控制...
方法一,先 clone 父项目,再初始化 submodule,最后更新 submodule。 初始化只需要做一次,之后每次只需要直接 update 即可,需要注意 submodule 默认是不在任何分支上的,它指向父项目存储的 submodule commit id。 git clone project.git project2 cd project2 ...
After the clone is created, initialize all submodules within, using their default settings. This is equivalent to runninggit submodule update --init --recursiveimmediately after the clone is finished. This option is ignored if the cloned repository does not have a worktree/checkout (i.e. if ...
git submodule update --init --recursive1 如果你不确定子模块是否都已经下载完全了,也可以执行一遍这个命令确认一下。 3. 参考 git clone --help git 2.7.4版本: --recursive, --recurse-submodules After the clone is created, initialize all submodules within, using their default settings. This is eq...
git clone --recurse-submodules[=<pathspec]: After the clone is created, initialize and clone submodules within based on the provided pathspec (or all submodules if no pathspec is given). This may be a good option if you are cloning a repository that you know to have submodules, and you...
After the clone is created, initialize and clone submodules within based on the provided pathspec. If no pathspec is provided, all submodules are initialized and cloned. This option can be given multiple times for pathspecs consisting of multiple entries. The resulting clone hassubmodule.activeset...
After the clone is created, initialize all submodules within, using their default settings. This is equivalent to runninggit submodule update --init --recursiveimmediately after the clone is finished. This option is ignored if the cloned repository does not have a worktree/checkout (i.e. if ...