无法使用子模块推送 Git 存储库的提交

Fre*_*ith 5 git github git-submodules git-commit

我最近将子模块“C”添加到我的存储库“B”中,然后检查了子模块 C(我想包含在 B 中的该工具的先前版本)中的特定提交,然后提交 B 并尝试推送。我收到此错误:

$ git push --recurse-submodules=on-demand
Run Code Online (Sandbox Code Playgroud)

...

Everything up-to-date
The following submodule paths contain changes that can
not be found on any remote:
  _submodules/C

Please try

        git push --recurse-submodules=on-demand

or cd to the path and use

        git push

to push them to a remote.

fatal: Aborting.
fatal: The remote end hung up unexpectedly
gitpub error:  process git-shell failed with status 128
Run Code Online (Sandbox Code Playgroud)

我应该提到的是,我检出的 C 中的提交是无父/分离的(不知道为什么开发人员选择这样)。当我想在 B 中推送我的提交时,这似乎会导致问题。提到 B 也是超级项目 A 的子模块也可能相关。

感谢您提供的任何见解。

Fre*_*ith 5

好吧,作为 Git 的新手,我错过了--recurse-submodules为了我的目的不应该包含推送命令。我相信我收到了我所做的消息,因为它认为我也想将提交推送到子模块,而该子模块没有分支。