Download only a github folder

2

It is possible to download only a specific folder from a git repository, for example, if I have a project on github and it is made up of several folders, if at a certain moment I wish to download only a specific folder, is this possible ? '

    
asked by nullptr 05.02.2017 в 23:40
source

2 answers

2

From Git 1.7.0 you can do a sparse-checkout

You have to start an empty repository first with the remote

git init <repositorio>
cd <repositorio>
git remote add -f origin <url>

// activar sparse-checkout
git config core.sparsecheckout true

To define which folders / files you want to receive, you have to define them in .gut / info / sparse-checkout, for example (content of the sparse-checkout file):

alguna/carpeta/
otra/carpeta/mas/

You can finally update your local remote repository:

git pull origin master

With git < version 1.7.0 there is no possibility of doing a partial check out.

    
answered by 06.02.2017 в 02:58
1

The website link allows you to download the desired folder of a project, you just have to indicate the url and that's it, it's comfortable and easy.

    
answered by 06.02.2017 в 15:05