Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t使用子模块推送Git repo的提交_Git_Github_Git Submodules_Git Commit - Fatal编程技术网

Can';t使用子模块推送Git repo的提交

Can';t使用子模块推送Git repo的提交,git,github,git-submodules,git-commit,Git,Github,Git Submodules,Git Commit,我最近在我的repo“B”中添加了子模块“C”,然后检查了子模块C中的一个特定提交(我想在B中包含该工具的早期版本),然后提交了B并尝试推送。我得到这个错误: $ git push --recurse-submodules=on-demand 我应该提到,我签出的C中的提交是无父/分离的(不确定开发人员为什么选择这种方式)。当我想在B中推送我的提交时,这似乎会引起一个问题。提到B也是超级项目a的子模块也可能是相关的 感谢您提供的任何见解。好的,由于对Git来说相对较新,我错过了push命令不

我最近在我的repo“B”中添加了子模块“C”,然后检查了子模块C中的一个特定提交(我想在B中包含该工具的早期版本),然后提交了B并尝试推送。我得到这个错误:

$ git push --recurse-submodules=on-demand

我应该提到,我签出的C中的提交是无父/分离的(不确定开发人员为什么选择这种方式)。当我想在B中推送我的提交时,这似乎会引起一个问题。提到B也是超级项目a的子模块也可能是相关的


感谢您提供的任何见解。

好的,由于对Git来说相对较新,我错过了push命令不应该包含用于我的目的的递归子模块。我相信我收到了这样的消息,因为它认为我还想将提交推送到没有分支的子模块。

您还可以配置它
git config--local push.recursesubmodules no
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