Thanks for the update. I created the bare repo first (*GitRepoCreation.jpeg
is the first screen shot*) and then I added a submodule (*submodule
creation.jpeg is the second screen shot*). So before dealing with sub
modules, we need to do at least one commit to the corresponding repo which
we are going to add as a submodule right?
On Monday, 1 October 2012 02:31:45 UTC+5:30, Philip Oakley wrote:
> I didn't fully understand all the screen shots (e.g.which came first),
> but I did notice you had a --bare repo at one stage. Obviously (?) you
> can't do any work in such a repo as it has no working directory, and so you
> couldn't add a sub-module to it.
> I'd suggest you at least get the initial commit into both the super
> project and sub-project (even it it is just the .gitignore files) before
> you try the sub-module add just to eliminate any confusion.
> Please reply-to-all.
> ----- Original Message -----
> *Sent:* Sunday, September 30, 2012 12:41 PM
> *Subject:* [git-users] Problem while adding a submodule from an empty repo
> I am facing some issues while adding a submodule.
> 1. I created an empty repo (*testsub.git*) - please check the *
> GitRepoCreation.jpeg* (as user git).
> 2. Then I tried to add the repo as a submodule in my project (as user
> anand) - please check the* submodule creation.jpeg. *
> 3. When I added the sub project, its showing a message *"warning: You
> appear to have cloned an empty repository."*. I understand this is due to
> the fact that I created the repository testsub.git as an empty one.
> 4. When I move to the submodule (cd testsub) and do a git status; it shows
> on a *null* branch.
> 5. I understand that initially it would be headless and we have to do git
> checkout master to move to the master branch. I did that but I got an error
> "*error: pathspec 'master' did not match any file(s) known to git*.".
> Now I dont know how to proceed on adding/commiting/pushing a new file
> using this sub module without being in any branch. Can some one please help?
> Anand Krishnan
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To view this discussion on the web visit
> To unsubscribe from this group, send email to
> For more options, visit this group at
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.2221 / Virus Database: 2441/5299 - Release Date: 09/29/12
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To view this discussion on the web visit
To post to this group, send email to firstname.lastname@example.org.
To unsubscribe from this group, send email to
For more options, visit this group at