你必须运行两个命令:git submodule init用来初始化本地配置文件,而git submodule update则从该项目中抓取所有数据并检出父项目中列出的合适的提交。 $ git submodule init Submodule'DbConnector'(https://github.com/chaconinc/DbConnector) registered for path 'DbConnector'$ git submodule update Cloning into'DbC...
➜ git submodule add https://github.com/username/project-sub-1.git 正克隆到'/path/to/project-main/project-sub-1'... remote: Enumerating objects: 3,done. remote: Counting objects: 100%(3/3),done. remote: Total3(delta 0), reused0(delta 0), pack-reused0展开对象中: 100%(3/3), ...
在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 submodule add sub_repo_url # 这里就给当前repo添加了 submodule, 同时submodule的代码也会clone下来 如何在包含submodules的repo中工作 sub-repo发生了修改,如果同步到当前repo #在submodule目录下 git fetch git merge # 以上两个也可以用一个命令代替 git pull remote_url remote_branch # 不在submodule目录...
git-pull - Fetch from and integrate with another repository or a local branch SYNOPSIS git pull[<options>] [<repository> [<refspec>…]] DESCRIPTION Incorporates changes from a remote repository into the current branch. If the current branch is behind the remote, then by default it will ...
git submodule update –init –recursive “` 这个命令会更新所有子模块的代码。 以上是一些常用的命令来拉取远程代码。根据实际情况,可以选择合适的命令来操作。 在Git中,要从远程仓库拉取代码,可以使用”git pull”命令。下面是git拉取远程代码的操作流程: ...
If you really want to remove a submodule from the repository and commit that usegit-rm[1]instead. Seegitsubmodules[7]for removal options. update [--init] [--remote] [-N|--no-fetch] [--[no-]recommend-shallow] [-f|--force] [--checkout|--rebase|--merge] [--reference <repository...
这行命令应该会拉取所有被git submodule init的submodule,如果只想更新特定的submodule,那么可以输入: git submodule update--remote<pathtothe submodule> 五. Git移除submodule 看到网上说的步骤如下: To remove a submodule you need to: Delete the relevant section from the .gitmodules file. ...
git-submodule.sh git-submodule.sh: rename some variables Dec 11, 2024 git-svn.perl Makefile: consistently use @Placeholder@ to substitute Dec 7, 2024 git-web--browse.sh git-web--browse.sh: use the $( ... ) construct for command substitution Apr 24, 2014 ...
2.4 更新主项目的Submodules 好的,让我们先进入project1目录同步仓库: ➜ henryyan@hy-hp ~/submd/ws/project1-b git:(master) cd ../project1 ➜ henryyan@hy-hp ~/submd/ws/project1 git:(master) git pull remote: Counting objects: 5, done. ...