Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,297,477
Community Members
 
Community Events
165
Community Groups

Clone only certain folders of a repository

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 Leader Oct 05, 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

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
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,214 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you