初始化子模块:git submodule init 更新子模块:git submodule update 递归克隆整个项目submodule:git clone https://github.com/demo.git assets --recursive 递归更新整个项目submodule:git submodule foreach git pull 删除子模块:git rm --cached subModulesA rm -rf subModulesA --recursive表示递归地克隆git_pare...
Add submodules Clone project with submodules Get latest submodules Pull changes in Submodule Make changes to submodule Push changes to remote Reference 我们经常需要在项目A中使用其他项目B,项目B可能是第三方的库或者被多个项目共享的子项目。Git提供submodules来解决这个问题,通过在项目A中保留项目B的目录,这...
➜ henryyan@hy-hp ~ /submd/ws/project1 git:(master) ✗ git submodule update ➜ henryyan@hy-hp ~ /submd/ws/project1 git:(master) ✗ git status # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "...
➜ /Users/diguage cd parent ➜ /Users/diguage/parent git:(master) git submodule update --init --recursive # 第二步 Submodule 'child' (git@:diguage/child.git) registered for path 'child' Cloning into 'child'... remote: Counting objects: 8, done. remote: Compressing objects: 100% ...
提交submodule 我们在project-main下,git status发现,多出来的是.gitmodules和文件夹project-sub-1,我们将它们视为普通的文件,提交并推送到远程。 anders@ubuntu:~/repo/project-main$ git status On branch master No commits yet Changes to be committed: (use "git rm --cached <file>..." to unstage) ...
Changestobe committed: (use"git reset HEAD <file>..."to unstage)newfile: .gitmodulesnewfile: child 这时,我们看到,除了刚刚添加的child模块外,还多了一个.gitmodules文件。这个文件就是用于记录子模块的路径已经远程版本库地址的地方。这两个文件处于待提交的状态。下面把这个修改提交一下。
git submodule update--remote<pathtothe submodule> 五. Git移除submodule 看到网上说的步骤如下: To remove a submodule you need to: Delete the relevant section from the .gitmodules file. Stage the .gitmodules changes git add .gitmodules
比如在公司不同开发团队中,有一个基础共享库,同时被多个项目调用。若要保证基础共享库的动态更新,那么就需要把共享库独立为一个代码库,但是分别把共享库...
When I was dealing with complex project with some submodules, submodules always get dirty after I configure them independently. This is very common but cause whole git dirty and ugly. Is there a simple way to solve something like this: On branch master Y
git config-f.gitmodules submodule.[submodule-name].branch[branch-name] 如果不用 -f .gitmodules 选项,那么它只会为你做修改。但是在仓库中保留跟踪信息更有意义一些,因为其他人也可以得到同样的效果。 https://blog.csdn.net/weixin_44070450/article/details/107701812 ...