git - git push --recurse-submodules=check 推送到远程,即使有子模块在他们的远程之前
问题描述
我有以下文件夹结构
-outerRepo
-innerRepo
-innerRepo2
-innerRepo3
其中innerRepo
,innerRepo2
和innerRepo3
是子模块。
当我运行时,git submodule foreach git status
我得到以下输出
Entering 'innerRepo'
On branch master
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: stuff.html
Entering 'innerRepo2'
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
Entering 'innerRepo3'
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
据我所知,在git push --recurse-submodules=check
里面运行outerRepo
不应该推送任何东西,因为如图git submodule foreach git status
所示,有一些子模块提交在其远程中不可用。我应该首先推送子模块中的提交。但是,当我更改内部文件outerRepo
并提交它时,git push --recurse-submodules=check
仍然会将文件推送到远程。这怎么可能?我正在跑步git version 2.30.1.windows.1
。
解决方案
推荐阅读
- c++ - 如何转换 unique_ptr
* 到 unique_ptr *? - javascript - 角度订阅自定义对象并在每次输入更改时保存到 localStorage
- python - Xpath 硒查找元素
- libreoffice-calc - Ubound(Array()) 无法使用 .getDataArray() 方法知道数组中有多少元素
- e-commerce - 如何扩展 Shopware 6 搜索,以便按自定义字段、制造商名称、产品 ID 等进行搜索?
- swift - 围绕 3rd 方 SDK 编写组合包装器
- azure - 我可以在云中创建 Azure AD 用户帐户,然后同步到本地 Azure 吗?
- python - 如何在 Django 中创建对等组?
- reactjs - 在 src 文件夹上运行 npm install 后,它显示未找到存储库
- asp.net - 为什么授权属性策略参数仅限于 const?