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.

Philip
Please reply-to-all.
  ----- Original Message ----- 
  From: Anand Krishnan 
  To: [email protected] 
  Sent: Sunday, September 30, 2012 12:41 PM
  Subject: [git-users] Problem while adding a submodule from an empty repo


  Hi
  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 
https://groups.google.com/d/msg/git-users/-/fUlOfAFxhSQJ.
  To post to this group, send email to [email protected].
  To unsubscribe from this group, send email to 
[email protected].
  For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



------------------------------------------------------------------------------


  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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to