git submodule add error: does not have a commit checked out

拟墨画扇 提交于 2020-01-13 19:22:04

问题


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' does not have a commit checked out

I already made this with other git repositories to the same repository "workspace" and worked well.

What I'm doing wrong?


回答1:


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.




回答2:


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


来源:https://stackoverflow.com/questions/56799562/git-submodule-add-error-does-not-have-a-commit-checked-out

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!