本文介绍了无法'git submodule foreach git pull`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 这个问题是基于这个线程 a>。 我的.gitmodules位于我的家中 [submodulebin] path = bin url = git://github.com/masi/bin.git 我的家庭中的文件夹 - 结构: 〜 | - [drwxr-xr-x] bin //这是我制作子模块的文件夹//它也是一个文件夹,我有一个Git推我的子模块的文件 | - fileA ` - folderA ... 我运行 git submodule init#我得不到这些命令的输出 git子模块更新 我运行 git submodule foreach git拉 我得到 输入'bin'致命:您想从现在开始取什么? 停在'bin'处;脚本返回非零状态。 我的第一个修正错误的方法是改变 path = bin 到 path = / Users / Masi / bin 。但是,这并不能解决问题。 如何从外部存储库(我的Git中的子模块)上载内容? 解决方案这通常是没有远程配置时发生的错误。 (From this thread ) 它是一个修补程序,至少可以修复在很久以前初始化的仓库中运行git pull时的回归,该仓库不使用.git / config文件指定远程仓库的位置。 因此,此消息表明.git / modules中提到的远程回购没有在.git / config 从 git submodule 子模块不要与遥控器混淆,遥控器主要用于同一项目的分支机构; 子模块用于不同的项目喜欢构建源代码树的一部分,而两个项目的历史仍保持完全独立,并且不能从主项目中修改子模块的内容。 我相信你可能错过了 git submodule init 的步骤: 子模块initSo this message indicates the remote repo mentioned in .git/modules is not declared in .git/configFrom git submoduleSubmodules are not to be confused with remotes, which are meant mainly for branches of the same project;submodules are meant for different projects you would like to make part of your source tree, while the history of the two projects still stays completely independent and you cannot modify the contents of the submodule from within the main project.I believe you may have missed the step of git submodule init:submodule initIf your remote repo (declared in .git/modules) is adequately referenced in .git/config, you should not have this error message anymore.Before using (pullin) submodules, the steps:git submodule initgit submodule updateremain necessary. 这篇关于无法'git submodule foreach git pull`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!