小编Fre*_*ith的帖子

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

我最近将子模块“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 的子模块也可能相关。

感谢您提供的任何见解。

git github git-submodules git-commit

5
推荐指数
1
解决办法
4048
查看次数

标签 统计

git ×1

git-commit ×1

git-submodules ×1

github ×1