美文网首页
submodule 指定对应分支

submodule 指定对应分支

作者: driver_ab | 来源:发表于2022-04-18 17:45 被阅读0次

引用来源:https://blog.csdn.net/weboof/article/details/108517187

1、创建子模块时指定一个分支

通过 -b 指定对应分支

git submodule add -b master [URL to Git repo];

2、在.gitmodules 文件中设置分支

其中 DbConnector 是主目录中安装的子目录的名称, stable 是对应要设置的分支名称

git config -f .gitmodules submodule.DbConnector.branch stable

3、主目录中找到对应的子模块,切换到对应的分支

其中 project 主项目, submoduleA 子模块, git checkout 切换到我们的对应分支,然后拉取对应分支代码

cd project/submoduleA
git checkout master
cd ..
git submodule foreach git pull
cd ..

相关文章

  • submodule 指定对应分支

    引用来源:https://blog.csdn.net/weboof/article/details/1085171...

  • git submodule 删除 更新 子库

    删除一个submodule 1.删除 .gitsubmodule中对应submodule的条目 2.删除 .git...

  • EOS搭建网络

    安装本地环境 下载代码 下载最新代码,master 分支即可,--recursive 会把submodule 也一...

  • gitlab

    git clone 不指定分支 git clone 指定分支

  • git 命令

    添加项目的依赖模块git submodule update --init 克隆仓库的master分支git clo...

  • Git pull

    1、将远程指定分支 拉取到 本地指定分支上 2、将远程指定分支 拉取到 本地当前分支上 3、将与本地当前分支同名的...

  • Git常用操作命令收集

    远程仓库相关命令 分支(branch)操作相关命令 版本(tag)操作相关命令 子模块(submodule)相关操...

  • 子模块

    子模块统一切分支git submodule foreach 'git checkout v1.2.1' 子模块统一...

  • Git常用命令

    远程仓库相关命令 2)分支(branch)操作相关命令 3)版本(tag)操作相关命令 子模块(submodule...

  • git操作之pull拉取远程指定分支以及push推送到远程指定分

    一、pull操作 1、将远程指定分支 拉取到 本地指定分支上: git pull origin <远程分支名>:<...

网友评论

      本文标题:submodule 指定对应分支

      本文链接:https://www.haomeiwen.com/subject/dawdertx.html