How to download a single Branch folder from a GitHub repository
aspnetcore/
├── main/
│ ├── .......
│ ├── docs
│ ├── .......
│ ├── src
│ └── .......
└── release/2.2
|...........
├── docs
├── .........
└── src
|...........
└─── Templating
|...........
├── src
│ |...........
│ ├── Microsoft.DotNet.Web.ProjectTemplates
│ │ |...........
│ │ └─── content
│ │ |...........
│ │ └── RazorPagesWeb-CSharp
│ │
│ │...........
├
│...........
I wanted to download a folder from the GitHub branch. But how can we download only a folder (or part of the source), there is no option on the GitHub website to download a folder.
At the time of writing this easiest way to do this is to use the code sandbox.
Here is the magic
Open repo to code sandbox by replacing github to githubbox in URL. Then on code sandbox go to files pain on the left and hover the mouse over the down arrow, it will show a popup tooltip "Export to Zip". Just click on it to download the folder as a zip file.
An example
To get the following small size folder from the huge aspnetcore repo: https://github.com/dotnet/aspnetcore/tree/v2.2.13/src/Templating/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp
Just change only the github.com part of the URL to githubbox.com
https://githubbox.com/dotnet/aspnetcore/tree/v2.2.13/src/Templating/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp
Figure 1
This saved my time a lot in the past. Hope this will useful for someone as well.
Comments
Post a Comment