这个问题基于这个讨论。
我的.gitmodules文件在我的主目录下
[submodule "bin"]
path = bin
url = git://github.com/masi/bin.git
我的家庭文件夹结构:
~
|-- [drwxr-xr-x] bin // this is the folder which I make a submodule
// it is also a folder where I have a Git to push my submodule's files
| -- fileA
` -- folderA
...
我运行
git submodule init # I get no output from these commands
git submodule update
我运行
git submodule foreach git pull
我获得
Entering 'bin'
fatal: Where do you want to fetch from today?
Stopping at 'bin'; script returned non-zero status.
我修复这个bug的第一个假设是将path = bin
更改为path = /Users/Masi/bin
。然而,这并没有解决问题。
你如何从我的Git子模块中的外部存储库上传内容?
.git/config
文件也包含一个[submodule "bin"]
部分,则该子模块可能是递归的(即,它将自身作为子模块包含在内)。这可能会导致很多混乱。 - Greg Hewgill