dgaspar
dgaspar

Reputation: 654

svn:externals a sub-folder of a git project

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

Upvotes: 2

Views: 936

Answers (2)

Nick Hengeveld
Nick Hengeveld

Reputation: 91

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.

Upvotes: 2

dgaspar
dgaspar

Reputation: 654

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.

Upvotes: 2

Related Questions