Git子模块。拉入超级项目的新克隆 [英] Git Submodules. Pulling into a new clone of the super-project
问题描述
行。所以我认为我有这个舔...但现在....
我有一个项目,其中包括一个来自GitHub的小型库作为子模块。在该超级项目的原始版本中,子模块按预期工作。然而,我只是克隆了超级项目,做了我认为我应该做的事情:git submodule init,得到子模块的目录,但它是空的。 / p>
如果我现在尝试做
git submodule update
我得到
致命:需要单一修订
无法在子模块路径'external_libraries / BEACHhtml'中找到当前修订版本
如果我尝试
git submodule foreach git pull
我得到
输入'external_libraries / BEACHhtml'
致命的:你今天想从哪里获取?
停在'external_libraries / BEACHhtml';脚本返回非零状态。
在我的.git / config中,我有这个:
[submoduleexternal_libraries / BEACHhtml]
url = git@github.com:interstar / BEACHhtml.git
在我的.gitmodules中我有这个:
pre $[submoduleexternal_libraries / BEACHhtml]
path = external_libraries / BEACHhtml $ b $ url url = git@github.com:interstar / BEACHhtml.git
任何人都知道缺少什么?
我有同样的问题和你一样。这是git中的一个错误: http: //lists-archives.com/git/785138-git-submodule-update-is-not-fail-safe.html
总之,对于你的问题,试试:
#rm -rf external_libraries / BEACHhtml
#git submodule update
code>
看起来前面的checkout文件夹有问题,删除它,再次更新可以解决问题。
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?
I have the same problem as you. This is a bug in git: http://lists-archives.com/git/785138-git-submodule-update-is-not-fail-safe.html
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.
这篇关于Git子模块。拉入超级项目的新克隆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!