Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Clone only certain folders of a repository

Gsep Support October 5, 2021

Hello Team,

        The Bitbucket repository has over 7gb data out of which only certain folders are needed (Around 700mb).

We would like to clone only the required files from the Bitbucket repository to avoid downloading excess files and speed up the development process

Can you please help regarding the script or commands that are needed to get only required files to clone from repo.

 

Thanks,

Siva

1 answer

0 votes
Mikael Sandberg
Community Champion
October 5, 2021

You could do this by using a combination of git sparse checkout and shallow clone. Have a look at this thread on how to combine these commands, https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository/28039894#28039894

Gsep Support October 10, 2021

The command "git pull --depth=1 origin master" takes hours to complete although the directory which has been selected for clone (through the echo command) is few kb. What might be the reason for this?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.12.1
TAGS
AUG Leaders

Atlassian Community Events