git submodule add 错误:没有检出提交
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/56799562/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git submodule add error: does not have a commit checked out
提问by Ricardo Rocha
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 confusionmatrixrepository as submodule like this:
我在 bitbucket 的帮助下创建了一个新的 git 存储库,称为混淆矩阵。现在,我正在另一个 git 存储库(称为workspace)中尝试将混淆矩阵存储库添加为子模块,如下所示:
git submodule add https://[email protected]/..../confusionmatrix.git
But I'm getting the following error:
但我收到以下错误:
'confusionmatrix' does not have a commit checked out
“confusionmatrix”没有检出提交
I already made this with other git repositories to the same repository "workspace" and worked well.
我已经将它与其他 git 存储库一起制作到同一个存储库“工作区”并且运行良好。
What I'm doing wrong?
我做错了什么?
回答by VonC
If you just created an emptyGit repository on BitBucket, try and make sure to make at least one commit (or push one commit) to it.
如果您刚刚在 BitBucket 上创建了一个空的Git 存储库,请尝试确保至少对其进行一次提交(或推送一次提交)。
Do that beforereferencing that repository as a submodule in your second local repository.
在将该存储库作为第二个本地存储库中的子模块引用之前执行此操作。
回答by user11879915
git commit -m "if you have something you want to Keep comment"
delete branch manually with all files on your disc
使用光盘上的所有文件手动删除分支
git clone https://WhereMyOriginIs" MyLocalFolderName