Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Download a single folder or directory from a GitHub repository

How can I download only a specific folder or directory from a remote Git repository hosted on GitHub?

Say the example GitHub repository lives here:

[email protected]:foobar/Test.git

Its directory structure:

Test/
├── foo/
│ ├── a.py
│ └── b.py
└── bar/
 ├── c.py
 └── d.py

I want to download only the foo folder and not clone the whole Test project.

Answer*

Draft saved
Draft discarded
Cancel
1
  • 1
    This works only for single files. The OP is asking for a way to download a folder and the download_url for folders is null. Please, read the question carefuly, before posting an answer. Commented Dec 6, 2020 at 16:55

AltStyle によって変換されたページ (->オリジナル) /