Git submodules in Github repo


In my project, im using a third party library. I had git cloned this lib in my project, and then had done git submodule init and git submodule update in the lib folder. I pushed my main project to github, but the contents of this third party lib were not sent and the lib folder appears like a green folder in my github project repo.

If i clone my main project on another machine, i dont have the contents of the lib there.So, should i git clone the lib again on the machine and run the init and update commands again or is there any way to push the contents of the 3rd party lib to my github repo ?

Thank You

Note that since April, 30th 2013, when you view a repository with a submodule on, you get useful links and information for the submodule:

You now can see what exact reference a submodule points to.

The Repository Contents API will reflect that SHA1.


  "name": "qunit",
  "path": "test/qunit",
  "type": "submodule",
  "submodule_git_url": "git://",
  "sha": "6ca3721222109997540bd6d9ccd396902e0ad2f9",
  "size": 0,
  "url": "",
  "git_url": "",
  "html_url": "",
  "_links": {
    "self": "",
    "git": "",
    "html": ""