例如: bash git submodule set-branch modules/my-submodule feature-branch 这将更新 .gitmodules 文件中的分支信息,但不会立即切换子模块的分支。你需要手动进入子模块目录并切换到新分支,如前面所述。 通过以上步骤,你可以成功地设置或更改 Git 子模块的分支。
or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...] or: git submodule [--quiet]set-branch (--default|--branch <branch...
or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...] or: git submodule [--quiet] set-branch (--default|--branch <branc...
再比如git add这个命令,由图可知,它是把修改放在了stage区域;而git commit命令则是把stage的内容提交到branches区域(确切说branch以及branch引用的objects,这个大家读过3.2节就能理解了),这也是为什么当你修改了文件而没有先执行git add,而直接执行git commit,系统会提示你"nothing added to commit"。其他命令我们这里...
[--] <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[--...
git branch:此命令用于创建、列出或删除存储库中的分支。分支允许多个开发人员同时在同一个存储库上工作而不会互相干扰。(该git branch -M main命令将当前分支重命名为“主”。该-M选项代表“移动/重命名”,用于在 Git 中移动或重命名分支。) git merge:此命令用于将更改从一个分支合并到另一个分支。它允许开...
设置git submodules后切换分支the following untracked working tree files would,1. Git 配置--system#系统级别--global#用户全局--local#单独一个项目gitconfig--globaluser.name"xxxx"#用户名gitconfig--globaluser.email"xxxx@xxx.com"#邮箱gitconfig--list#
# git-submodule.sh: add, init, update or list git submodules # # Copyright (c) 2007 Lars Hjemli dashless=$(basename "$0" | sed -e 's/-/ /') USAGE="[--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>...
当我在子模块文件夹中运行git branch -a时,我注意到我的特性分支没有列出。我试着通过运行git submodule add -b feature来添加它,但是没有成功。 当我在子模块文件夹中运行git status时,它显示: On branch develop Your branch is up to date with 'origin/develop' ...
git-submodule - Initialize, update or inspect submodules 用法概要 git submodule [--quiet] add [-b branch] [-f|--force] [--reference <repository>] [--] <repository> [<path>] git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...] git submodule [--quiet] ...