1,在主模块目录pull会更新主模块,但是对于子模块,只会获取子模块的更新记录,但不会去更新子模块文件。 2,子模块submodule update方式更新,需要加–remote和–merge,其中–remote表示将子模块远程仓库的更新合并到本地(否则还是主模块里记录的最后commit的那个submodule版本,而不一定是子模块远程最新版本),–merge表示将...
我一开始直接用的git submodule update --remote path-to-submodule的指令,cmd界面上成功走完了,没报错,但是我进去我的submodule里,发现文件内容并没有改变,所以我想,应该是更新了对应的commits,但是我的submodule仓库的HEAD指针指向的版本没有修改。 所以我做了接下来的尝试,首先cd到submodule对应的文件夹里面,输入gi...
在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 update 更新子模块的代码,但那是指 当前主项目文件夹下的子模块目录内容与当前主项目记录的子模块版本不一致时,会参考后者进行更新,而我们在sub-project独立项目上修改代码后提交主项目并不知晓。 此时我们进入submodule(sub-project)文件路径下 拉取submodule的master分支代码 git pull or...
$ git submodule update --remote xxx // 指定需要同步的子模块 子模块目录下更新: git pull 默认情况下会跟踪子模块的 master 分支,设置为其他分支: a. .gitmodules 设置 git config -f .gitmodules submodule.[submodule-name].branch [branch-name] ...
git pull 默认情况下会跟踪子模块的 master 分支,设置为其他分支: a. .gitmodules 设置 代码语言:javascript 代码运行次数:0 运行 AI代码解释 git config-f.gitmodules submodule.[submodule-name].branch[branch-name] 如果不用 -f .gitmodules 选项,那么它只会为你做修改。但是在仓库中保留跟踪信息更有意义一...
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来递归的初始化并下载子模块仓库的内容。或者,跑到子...
In the case where the path is a submodule, if the submodule commit used on one side of the merge is a descendant of the submodule commit used on the other side of the merge, Git attempts to fast-forward to the descendant. Otherwise, Git will treat this case as a conflict, suggesting ...
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. ...