0

Possible Duplicate:
Is there any way to clone a git repository’s sub-directory only?
clone parts of a github project

I am new to Git and Github, and I'd like to check out a project hosted there and work on it, but there is quite a bit of source to check out. I really only want to check out one module, but I can't seem to find the right commands.

I really just want this. I've forked it, but the fork seems to be the whole project, and I have no idea how to pull down only the submodule.

I tried this:

$ git submodule add git@github.com:javamonkey79/restlet-framework-java modules/org.restlet.ext.jaxrs

And this:

$ git submodule add git@github.com:javamonkey79/restlet-framework-java.git modules/org.restlet.ext.jaxrs

But neither of these are right.

Is what I am trying to do possible? If so, how?

Community
  • 1
  • 1
javamonkey79
  • 17,443
  • 36
  • 114
  • 172

1 Answers1

3

You can't do this. You have to clone the whole repository. But you can checkout only subdirectories you really need using sparse checkouts

the.malkolm
  • 2,391
  • 16
  • 16
  • I don't understand how a sparse checkout helps. You still have to clone the whole project (pull it down from remote) - am I reading that right? – javamonkey79 Feb 03 '12 at 00:34
  • Please read my message again. I didn't say sparse can solve this problem. You have to checkout the whole repo anyway. There is no other way. But you can checkout only the directories you need. And yeah, btw you could checkout with --depth parameter as it could make it faster but make a clone limited by functionality. – the.malkolm Feb 06 '12 at 23:55