我有一个父存储库,它有分支master
stage
& develop
沿着一个子存储库,比如说子模块,它有相同的分支master
stage
& develop
,我在子资源库的stage
分支中进行了提交(submodule)并尝试将更改推送到父仓库中的stage
分支,但更改仍然没有反映在GitHub中。
注意:-它适用于父存储库的master
到子存储库的master
。用于主存储库的脚本
#!/bin/bash
git init
git clone --recurse-submodules https://github.com/username/file.git
cd file
git submodule update --remote
git commit -a -m "commit in both submodule"
git push -u origin
上面脚本适用于父存储库的master
到子存储库的master
,就像wise I want适用于父存储库的stage
到子存储库的stage
一样。
**我甚至尝试使用多个命令:- git push -u原始阶段git config push。默认当前git config push。默认上游
没有一个工作**
2条答案
按热度按时间vktxenjb1#
我准备了一个脚本,可以很好地用于分支到分支的提交/推送
4xy9mtcn2#
git init
+git clone
表示您正在将一个嵌套的Git仓库(及其潜在的子模块)克隆到一个新的本地Git仓库中。我不建议采取这种做法。
简单地说: