git子模块添加错误:没有签出提交 [英] git submodule add error: does not have a commit checked out

查看:1238
本文介绍了git子模块添加错误:没有签出提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我借助名为 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆