OK. So I thought I had this licked ... but now ....
I have a project which includes one small library from GitHub as a submodule. In the original version of that super-project the submodule is working as expected.
However, I just cloned the superproject, did what I thought I should : "git submodule init", got the directory of the submodule to appear, but it's empty.
If I now try to do
git submodule update
I get
fatal: Needed a single revision
Unable to find current revision in submodule path 'external_libraries/BEACHhtml'
If I try
git submodule foreach git pull
I get
Entering 'external_libraries/BEACHhtml'
fatal: Where do you want to fetch from today?
Stopping at 'external_libraries/BEACHhtml'; script returned non-zero status.
In my .git/config, I have this :
[submodule "external_libraries/BEACHhtml"]
url = git@github.com:interstar/BEACHhtml.git
In my .gitmodules I have this :
[submodule "external_libraries/BEACHhtml"]
path = external_libraries/BEACHhtml
url = git@github.com:interstar/BEACHhtml.git
Anyone got an idea what's missing?
解决方案
In short, for your problem, try:
# rm -rf external_libraries/BEACHhtml
# git submodule update
It seems there is something wrong with the previous checkout folder, remove it, and update again solves the problem.
本文介绍了如何处理在克隆项目时子模块为空的问题,涉及'gitsubmodule init', 'git submodule update'的操作,以及遇到错误'Unable to find current revision'的解决方案。关键步骤包括删除旧子模块并重新初始化。
1800

被折叠的 条评论
为什么被折叠?



