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


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://[email protected]/..../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?


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.

Answered By – VonC

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published