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?
This can happen if you have a git repo and then create/clone another repo in a subdirectory under that repo. In my case, I accidentally created a directory name ., inside the repository. Removing it solved the issue.
To add and commit files to a Git repositoryEnter git add --all at the command line prompt in your local project directory to add the files or changes to the repository. Enter git status to see the changes to be committed.
The git add command adds a change in the working directory to the staging area. It tells Git that you want to include updates to a particular file in the next commit. However, git add doesn't really affect the repository in any significant way—changes are not actually recorded until you run git commit .
To add a Git commit message to your commit, you will use the git commit command followed by the -m flag and then your message in quotes. Adding a Git commit message should look something like this: git commit -m “Add an anchor for the trial end sectionnn.”
As an FYI, the same message is shown if by accident you already have a .git folder in any of the subfolder under the folder you are trying to add. If that's the case, then delete the git subfolder and if any .vs file is there, delete that too. That was my case and I had the same error message.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With