创建submodule 进入project-main ,输入: git submodule add <submodule_url> 终端中跳出这样的字样: ➜ 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/...
我一开始直接用的git submodule update --remote path-to-submodule的指令,cmd界面上成功走完了,没报错,但是我进去我的submodule里,发现文件内容并没有改变,所以我想,应该是更新了对应的commits,但是我的submodule仓库的HEAD指针指向的版本没有修改。 所以我做了接下来的尝试,首先cd到submodule对应的文件夹里面,输入gi...
此时,若父级项目引用的子模块提交不在仓库中本地配置的子模块远端上,那么执行git pull --recurse-submodules或git submodule update就会失败。 为了补救,git submodule sync命令需要: # 将新的 URL 复制到本地配置中$ git submodule sync--recursive# 从新 URL 更新子模块$ git submodule update--init--recursive...
在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...
When working with submodules, a common pattern of confusion and error is forgetting to push updates for remote users. If we revisit theawesomelibrarywork we just did, we pushed only the updates to the parent repository. Another developer would go to pull the latest parent repository and it wo...
拉取submodule的master分支代码 git pull origin master EDZ@▒▒ƽ̨▒▒ҵ▒▒-▒▒ʫ▒▒ MINGW64 /d/project/main-project/sub-project (master) $ git pull origin master remote: Counting objects: 6, done. remote: Compressing objects: 100% (4/4), done. ...
➜/Users/diguage/parent git:(master) git submodule add git@github.com:diguage/child.git Cloning into'child'...remote: Countingobjects:5, done.remote: Compressingobjects:100% (5/5), done.remote: Total5 (delta0), reused0 (delta0), pack-reused0 ...
git submodule add https://github.com/appleboy/CodeIgniter-TW-Language user_guide 下這指令之前請注意最後面的 path 部份,請勿先建立空的目錄,也就是如果該目錄存在,就會衝突,所以並不需要額外幫 module 建立目錄,指令完成結果如下: 1 2 3 4 5 Cloning into user_guide... remote: Counting objects: ...
$ git submodule update --remote Clone包含子模块的项目 对于你的主仓库项目合作者来说,如果只是git clone去下载主仓库的内容,那么你会发现子模块仓库的文件夹内是空的! 此时,你可以像上面「添加子模块」中说到的使用git submodule update --init --recursive来递归的初始化并下载子模块仓库的内容。或者,跑到子...
$ git submodule update --remote DbConnector remote: Counting objects: 4, done. remote: Compressing objects: 100% (2/2), done. remote: Total 4 (delta 2), reused 4 (delta 2) Unpacking objects: 100% (4/4), done. From https://github.com/chaconinc/DbConnector ...