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*

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
2
  • 2
    Just need to change checkout to export if you just want to download a copy of the folder rather than checkout. Commented Sep 13, 2015 at 0:14
  • Thank you for your answer, can we dive a branch ? let's say I want to download feature1 branch's aaa folder Commented Nov 10, 2016 at 14:05

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