Search code examples
gitfilegithubdirectoryrepository

Download single file/folder from a Private GitHub repository (it contains multiple folders)


how to Download single file/folder from a Private GitHub repository hosted on GitHub. The repository structure is like

AndroidApps/
├── FirstAnimation/ 
│   ├── app
│   └── build.gradle
|   └── gradle.properties
|   └── ...
|
└── NavigationHelp/
|   ├── app
|   └── build.gradle
|   └── gradle.properties
|   └── ...
|
└── ChatApp/
    ├── app
    └── build.gradle
    └── gradle.properties
    └── ...

And I want to download only the NavigationHelp folder and not clone the whole AndroidApps project.

note-(previously answer given on Stack overflow related to public folder which does not work for private repo)


Solution

  • Whilst there could be better ways to do this. Here is what one can do (using website's GUI) to download file/folder from GIT repository (without having to clone the entire project):

    As asked: a) you can download a single file. Or b) you can download a single folder (with all its files - without having to clone entire project).

    To download individual file: using following steps to download a single file from GITHUB website:

    1. After signing in to the Github.com, -> open your Repository, -> open the target folder, -> click on "Go to file": enter image description here

    2. now right click on the target file and -> click "Save link as": enter image description here

    To download all project files with its folder-structure: To download all files & folders, log in to GIT online -> open the target project -> click "Code" dropdown and select "Download ZIP", this will download entire project (as zip file): enter image description here