int*_*tar 85 git git-submodules
好.所以我以为我有这个舔...但现在....
我有一个项目,其中包括一个来自GitHub的小型库作为子模块.在该超级项目的原始版本中,子模块按预期工作.
但是,我只是克隆了超级项目,做了我认为应该做的事情:"git submodule init",得到子模块的目录,但它是空的.
如果我现在尝试做
git submodule update
Run Code Online (Sandbox Code Playgroud)
我明白了
fatal: Needed a single revision
Unable to find current revision in submodule path 'external_libraries/BEACHhtml'
Run Code Online (Sandbox Code Playgroud)
如果我试试
git submodule foreach git pull
Run Code Online (Sandbox Code Playgroud)
我明白了
Entering 'external_libraries/BEACHhtml'
fatal: Where do you want to fetch from today?
Stopping at 'external_libraries/BEACHhtml'; script returned non-zero status.
Run Code Online (Sandbox Code Playgroud)
在我的.git/config中,我有这个:
[submodule "external_libraries/BEACHhtml"]
url = git@github.com:interstar/BEACHhtml.git
Run Code Online (Sandbox Code Playgroud)
在我的.gitmodules中我有这个:
[submodule "external_libraries/BEACHhtml"]
path = external_libraries/BEACHhtml
url = git@github.com:interstar/BEACHhtml.git
Run Code Online (Sandbox Code Playgroud)
任何人都知道缺少什么?
Han*_* He 186
我和你有同样的问题.这是git中的一个错误:http://lists-archives.com/git/785138-git-submodule-update-is-not-fail-safe.html
简而言之,对于您的问题,请尝试:
# rm -rf external_libraries/BEACHhtml
# git submodule update
Run Code Online (Sandbox Code Playgroud)
以前的checkout文件夹似乎有问题,删除它,并再次更新解决问题.
通过删除 2 个目录并重新获取子模块解决:
external_libraries/BEACHhtml并查看.git文件。它的内容应该是这样的gitdir: ../../.git/modules/external_libraries/BEACHhtmlexternal_libraries/BEACHhtml和.git/modules/external_libraries/BEACHhtml目录。从现在开始git submodule update运行没有错误。
| 归档时间: |
|
| 查看次数: |
56292 次 |
| 最近记录: |