2016-02-15 24 views
2

的主人我已经参考这样的:Git submodule head 'reference is not a tree' error如何设置子模块,这样混帐克隆--recursive始终以子模块

这:git submodule tracking latest

可能是我的问题略有不同。 (我假设它的相同,但没有做正确的事情...)

我希望我的git的设置,例如,如果我运行:

git clone -b master --recursive /path/to/main/repo.git 

子模块应始终对抗克隆“大师”

否则,在许多情况下,引用承诺不存在(子模块的分支),或者是“过时”导致克隆失败,出现错误:

fatal: reference is not a tree 

我试图建立的主要仓库取子模块主:

git submodule add -b master /path/to/submodule.git 

但克隆的主要回购时:

git clone -b master --recursive /path/to/main/repo.git 

子模块提交引用不存在(未以预期的方式取得主数据)

回答