git子模块添加错误:没有签出提交 [英] git submodule add error: does not have a commit checked out
问题描述
我借助名为 confusionmatrix 的bitbucket创建了一个新的git存储库.现在,我正在另一个git存储库(称为 workspace )中尝试添加 confusionmatrix 存储库作为子模块,如下所示:
I create a new git repository with the help of bitbucket called confusionmatrix. Now, I'm trying in another git repository (called workspace) add the confusionmatrix repository as submodule like this:
git submodule add https://....@bitbucket.org/..../confusionmatrix.git
但是我遇到了以下错误:
But I'm getting the following error:
'confusionmatrix'没有签出提交
'confusionmatrix' does not have a commit checked out
我已经将其与其他git存储库合并到同一存储库工作区"中,并且运行良好.
I already made this with other git repositories to the same repository "workspace" and worked well.
我做错了什么?
推荐答案
如果您刚刚在BitBucket上创建了一个 empty Git存储库,请尝试确保至少进行一次提交(或推送一次提交) ).
If you just created an empty Git repository on BitBucket, try and make sure to make at least one commit (or push one commit) to it.
在引用该存储库作为第二个本地存储库中的子模块之前,请先执行 .
Do that before referencing that repository as a submodule in your second local repository.
这篇关于git子模块添加错误:没有签出提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!