例如: bash git submodule set-branch modules/my-submodule feature-branch 这将更新 .gitmodules 文件中的分支信息,但不会立即切换子模块的分支。你需要手动进入子模块目录并切换到新分支,如前面所述。 通过以上步骤,你可以成功地设置或更改 Git 子模块的分支。
git submodule add https://github.com/user/repo 这将从给定的URL创建一个子模块,并将其添加到主仓库中。 指定分支 如果你只是想更新子模块的引用而没有更改子模块内部的任何文件,可以使用以下命令: git submodule set-branch --branch <new_branch> path_to_submodule 然后进入子模块,检出对应分支git checkout...
git submodule set-branch -b branchName sub-module-name 改变之后,需要注意的是当前子模块的commit并没有发生变化, 需要执行 git submodule update --remote 更新commit。 所以set-branch指令更像是在.gitmodules里面将分支的配置修改一下。 发现--default选项不能使用,可能是我使用的方式不对。 在子模块中的...
git submodule [--quiet] update [<options>] [--] [<path>…] git submodule [--quiet] set-branch [<options>] [--] <path> git submodule [--quiet] set-url [--] <path> <newurl> git submodule [--quiet] summary [<options>] [--] [<path>…] git submodule [--quiet] for...
git submodule [--quiet] update [<options>] [--] [<path>…]#更新子模块 git submodule [--quiet] set-branch [<options>] [--] <path>#子模块设置分支 git submodule [--quiet] set-url [--] <path> <newurl>#子模块设置访问的URL ...
git 添加子模块配置 submodule 1. 在.git同级目录创建 .gitmodules文件夹2. 进入bash界面3. git submodule add <子模块git clone的地址> <映射到本地文件夹路径 A/B/C>以上配置完成使用git add/commit 提交即可4. git submodule init 初始化子仓库5. git submodule update --recursive 更新仓库内容 提交代码...
)git submodule[--quiet] update [<单/多个选项>] [--] [<路径>…]git submodule[--quiet] set-branch [<单/多个选项>] [--] <路径>git submodule[--quiet] set-url [--] <路径> <newurl>git submodule[--quiet] summary [<单/多个选项>] [--] [<路径>…]git submodule[--...
or: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>] or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...] or: git submodule [--quiet] init [--] [<path>...] ...
[--] <path>…)git submodule[--quiet] update [<options>] [--] [<path>…]git submodule[--quiet] set-branch [<options>] [--] <path>git submodule[--quiet] set-url [--] <path> <newurl>git submodule[--quiet] summary [<options>] [--] [<path>…]git submodule[--...
or: git submodule [--quiet]set-branch (--default|--branch <branch>) [--] <path>or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...] or: git submodule [--quiet]foreach[--recursive] or: git submodule [--quiet] sync [-...