方法一,pull父项目,然后执行 git submodule update cd project git pull git submodule update --remote 方法二,进入子模块,切换到需要子模块分支,例子是 master 分支,然后对子模块 pull,这种方法会改变子模块的分支。 cd project/moduleA git checkout master git pull cd .. // 切换到父项目根目录 git sub...
git submodule foreach git pull: 拉取所有子模块 git submodule foreach git checkout -- .: 所有子模块进行 checkout -- . 操作。 代码语言:javascript 代码运行次数:0 运行 AI代码解释 NAMEgit-submodule-Initialize,update or inspect submodulesSYNOPSISgit submodule[--quiet]add[<options>][--]<repository...
从项目远端拉取上游更改 现在,让我们站在协作者的视角,他有自己的 MainProject 仓库的本地克隆, 只是执行 git pull 获取你新提交的更改还不够: $ git pull From https://github.com/chaconinc/MainProject fb9093c..0a24cfc master -> origin/master Fetching submodule DbConne...
如果给 git clone 命令传递 –recurse-submodules 选项,它就会自动初始化并更新仓库中的每一个子模块, 包括可能存在的嵌套子模块。 $ git clone --recurse-submodules https://github.com/chaconinc/MainProject Cloning into 'MainProject'... remote: Counting objects: 14, done. remote: Compressing objects:...
cat.gitsubmodules [submodule"lib"] path = lib url = /path/to/repos/lib.git 执行git status发现有了新的文件 git status On branch master Your branch is up todatewith'origin/master'. Changes to be committed: (use"git reset HEAD <file>..."to unstage) ...
git pull 默认情况下会跟踪子模块的 master 分支,设置为其他分支: a. .gitmodules 设置 代码语言:javascript 代码运行次数:0 运行 AI代码解释 git config-f.gitmodules submodule.[submodule-name].branch[branch-name] 如果不用 -f .gitmodules 选项,那么它只会为你做修改。但是在仓库中保留跟踪信息更有意义一...
Git submodules screenshot 文件夹@提交 Id格式表明这个存储库是一个子模块,你可以直接点击文件夹进入该子树。名为.gitmodules的配置文件包含所有子模块存储库的详细信息。我的存储库的.gitmodules文件如下: Screenshot of .gitmodules file 你可以用下面的命令在你的存储库中使用 Git 子模块: ...
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...
Optional <path> arguments limit which submodules will be initialized. If no path is specified and submodule.active has been configured, submodules configured to be active will be initialized, otherwise all submodules are initialized. It will also copy the value ofsubmodule.$name.update, if presen...
Wenn du mehrere Submodule hast, wirst du mehrere Einträge in dieser Datei haben. Beachte, dass diese Datei zusammen mit deinen anderen Dateien, wie z.B. der.gitignoreDatei, der Versionskontrolle unterliegen. Sie wird zusammen mit dem Rest deines Projekts gepusht und gepullt. So wissen ...