6

I am pulling a git repository from github. When I clone the repo there is one empty folder which should have contained a project. Since other projects are referring to this folder.

When I browse the repo on the github the folder shows in green color.

Is there something that I am missing ?

I am using

git clone https://github.com/TomTasche/Announcify.droid.git

The command works and it clones the repo successfully to my machine, but that green folder is empty , the rest of code is downloaded fine..

check this page of repo https://github.com/TomTasche/Announcify.droid

David Cain
  • 16,484
  • 14
  • 65
  • 75
Ahmed
  • 14,503
  • 22
  • 92
  • 150
  • what is `https://path`? It should be something like `git@github.com:username/reponame.git` or for http like `http://github.com/username/reponame.git` (and note that ssh is recommended over http) – eis Jun 19 '12 at 11:07
  • @eis I have updated the path in my question, the path is fine and git starts cloning everything. The only problem is one of the folder is empty and that folder shows green on github – Ahmed Jun 19 '12 at 11:12
  • Why not provide the real URL to the project you are talking about so the community can take a look and hopefully answer your question? – tobiasbayer Jun 19 '12 at 11:19
  • 1
    http://stackoverflow.com/questions/10753027/green-folder-on-the-ui-cant-drill-down-into-the-folder – rush Jun 19 '12 at 11:21
  • @CodeBrickie I thought that would violate terms of stackoverflow, my bad :) – Ahmed Jun 19 '12 at 11:22
  • That folder is a submodule: http://git-scm.com/book/en/Git-Tools-Submodules – Ben James Jun 19 '12 at 11:25

1 Answers1

6

It is a submodule. In your checked out project do git submodule update --init and it should fix things.

In the latest versions of git the clone operation has a --recursive option to automatically initialize the submodules but I don't think most tools are using this yet.

git submodule init dirname and git submodule update --init are the normal commands to create the local copy.

See the git book for more about submodules.

Looking closely at the linked repository - I think you might need to contact the author and get them to commit the .gitmodules file in the toplevel folder as that is where the submodule initialization configuration is stored. Here is a link to another project that has a submodule (msysgit) for comparison. In that project, the git folder is a submodule.

patthoyts
  • 32,320
  • 3
  • 62
  • 93
  • when I do git submodule update --init it says no submodule mapping found in .gitmodules for path API-Announcify – Ahmed Jun 19 '12 at 12:01
  • Like is mentioned - the author has neglected to add the .gitmodules file. If you know where the repository might be located you can just clone it in the right place yourself and that will resolve the issues. A submodule is just a clone with a known commit id to checkout. For doing development you clone and checkout an appropriate branch just like any normal repository. – patthoyts Jun 19 '12 at 12:09