Download a single folder or directory from a GitHub repo
Asked 07 September, 2021
Viewed 483 times
  • 54
Votes

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

Say the example GitHub repo 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.

30 Answer