GreenGiant
GreenGiant

Reputation: 5236

How to clone, based on a subpath within a remote repository

I'm new to git. I would like to clone a public remote git repository. I can successfully access this URL in my browser, and although the URL is https, no authentication is required. But when I attempt to clone it:

git clone https://github.com/droolsjbpm/drools/tree/6.0.x/drools-examples-api/named-kiesession-from-file

I get the following error:

Cloning into 'named-kiesession-from-file'...
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/droolsjbpm/drools/tree/6.0.x/drools-examples-api/named-kiesession-from-file/info/refs
fatal: HTTP request failed

I think the problem is that I may not have the root of the repository here, but rather a subpath. How do I determine what path is actually the root of the repository? Or is there a way to clone just a subpath?

Upvotes: 2

Views: 483

Answers (1)

hek2mgl
hek2mgl

Reputation: 157947

You can't clone just a folder of a repository. You need to clone the whole repository:

git clone [email protected]:droolsjbpm/drools.git

Upvotes: 3

Related Questions