2

is there a way to get only a part (ex: a sub-folder called /library) of a github.com project and use it in svn:externals?

What I'm doing now is

$svn pe svn:externals .
   SomeLibrary http://svn.github.com/myuser/myproject.git

But I don't want everything from the project... I need something like:

$svn pe svn:externals .
   SomeLibrary http://svn.github.com/myuser/myproject.git/library
dgaspar
  • 655
  • 6
  • 10
  • What happens when you do it exactly as you quote? Provided git are providing a proper SVN interface, that should work fine. – Pekka Jun 10 '10 at 19:51
  • Even if I put a valid path after myproject.git/././. , svn ignores it and downloads the whole project from its root.. :/ example: "svn checkout http://svn.github.com/beberlei/zf-doctrine.git/library lib" OBS: but if try an invalid path, ex: "svn checkout http://svn.github.com/beberlei/zf-doctrine.git/WRONGPATH lib", I get a svn: URL 'http://svn.github.com/beberlei/zf-doctrine.git/WRONGPATH' doesn't exist – dgaspar Jun 10 '10 at 21:12

2 Answers2

2

Github support has just replied my question:

this isn't possible, git is an all-or-nothing affair, you can't grab just a subpath.

dgaspar
  • 655
  • 6
  • 10
2

This is now supported on GitHub.

With no subpath specified the entire repo is fetched:

$ svn co https://github.com/myuser/myproject
A    myproject/branches
A    myproject/trunk
A    myproject/trunk/README.md
A    myproject/trunk/library
A    myproject/trunk/library/myproject.rb
A    myproject/trunk/library/myproject
A    myproject/trunk/library/myproject/sample.rb
Checked out revision 1.

And with a subpath specified, only that part of the repo is fetched:

$ svn co https://github.com/myuser/myproject/trunk/library
A    library/myproject.rb
A    library/myproject
A    library/myproject/sample.rb
Checked out revision 1.