The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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?

DEPLOYMENT TYPE
SERVER
VERSION
7.12.1
TAGS
AUG Leaders

Atlassian Community Events