๐๐จ๐ฐ ๐ฐ๐จ๐ฎ๐ฅ๐ ๐ฒ๐จ๐ฎ C๐ฅ๐จ๐ง๐ ๐ ๐ก๐ฎ๐ ๐ ๐๐ข๐ญ๐๐ฎ๐ ๐ซ๐๐ฉ๐จ ๐ฐ๐ข๐ญ๐ก ๐ญ๐จ๐ง๐ฌ ๐จ๐ ๐๐ข๐ฅ๐๐ฌ ๐ฐ๐ข๐ญ๐ก๐จ๐ฎ๐ญ ๐ข๐ญ ๐ญ๐๐ค๐ข๐ง๐ ๐ก๐จ๐ฎ๐ซ๐ฌ?


This was an ๐๐๐ฉ๐ช๐๐ก interview question I got recently.
And honestly?
I didn't have a solid answer back then because I hadn't faced that scenario before.
But after the interview, I decided to try cloning a massive repo to understand the pain and yep, it can take forever if you're not careful.
So here's what I found and what you can do to save time:
๐๐ฒ๐๐ ๐ช๐ฎ๐๐ ๐๐ผ ๐๐น๐ผ๐ป๐ฒ ๐ฎ ๐๐ฎ๐ฟ๐ด๐ฒ ๐๐ถ๐ ๐ฅ๐ฒ๐ฝ๐ผ ๐๐ณ๐ณ๐ถ๐ฐ๐ถ๐ฒ๐ป๐๐น๐
๐ญ. ๐ฆ๐ต๐ฎ๐น๐น๐ผ๐ ๐๐น๐ผ๐ป๐ฒ - Only clone the latest commit, not the entire history
๐ด๐ถ๐ ๐ฐ๐น๐ผ๐ป๐ฒ --๐ฑ๐ฒ๐ฝ๐๐ต ๐ญ <๐ฟ๐ฒ๐ฝ๐ผ-๐๐ฟ๐น>
๐ฎ. ๐ฆ๐ฝ๐ฎ๐ฟ๐๐ฒ ๐๐ต๐ฒ๐ฐ๐ธ๐ผ๐๐ - Clone only specific folders instead of the full repo:
๐ด๐ถ๐ ๐ฐ๐น๐ผ๐ป๐ฒ --๐ณ๐ถ๐น๐๐ฒ๐ฟ=๐ฏ๐น๐ผ๐ฏ:๐ป๐ผ๐ป๐ฒ --๐ป๐ผ-๐ฐ๐ต๐ฒ๐ฐ๐ธ๐ผ๐๐ <๐ฟ๐ฒ๐ฝ๐ผ-๐๐ฟ๐น>
๐ฐ๐ฑ <๐ฟ๐ฒ๐ฝ๐ผ>
๐ด๐ถ๐ ๐๐ฝ๐ฎ๐ฟ๐๐ฒ-๐ฐ๐ต๐ฒ๐ฐ๐ธ๐ผ๐๐ ๐ถ๐ป๐ถ๐ --๐ฐ๐ผ๐ป๐ฒ
๐ด๐ถ๐ ๐๐ฝ๐ฎ๐ฟ๐๐ฒ-๐ฐ๐ต๐ฒ๐ฐ๐ธ๐ผ๐๐ ๐๐ฒ๐ ๐ฝ๐ฎ๐๐ต/๐๐ผ/๐๐ผ๐๐ฟ-๐ณ๐ผ๐น๐ฑ๐ฒ๐ฟ
๐ฏ. ๐๐ถ๐ ๐๐๐ฆ (๐๐ฎ๐ฟ๐ด๐ฒ ๐๐ถ๐น๐ฒ ๐ฆ๐๐ผ๐ฟ๐ฎ๐ด๐ฒ) - If the repo has heavy media/binary files:
๐ด๐ถ๐ ๐น๐ณ๐ ๐ถ๐ป๐๐๐ฎ๐น๐น
๐ด๐ถ๐ ๐ฐ๐น๐ผ๐ป๐ฒ <๐ฟ๐ฒ๐ฝ๐ผ-๐๐ฟ๐น>
๐ฐ. ๐๐ผ๐ฐ๐ฎ๐น ๐๐น๐ผ๐ป๐ฒ ๐ณ๐ฟ๐ผ๐บ ๐ง๐ฒ๐ฎ๐บ๐บ๐ฎ๐๐ฒ - If someone already has it:
๐ด๐ถ๐ ๐ฐ๐น๐ผ๐ป๐ฒ /๐ฝ๐ฎ๐๐ต/๐๐ผ/๐น๐ผ๐ฐ๐ฎ๐น/๐ฟ๐ฒ๐ฝ๐ผ
๐ฑ. ๐จ๐๐ฒ ๐ช๐ถ๐ฟ๐ฒ๐ฑ/๐๐ฎ๐๐๐ฒ๐ฟ ๐ก๐ฒ๐๐๐ผ๐ฟ๐ธ - Sometimes, simple things help the most.
I hadnโt encountered this in real-world projects yet, but now Iโve learned it the hard way (thanks to the interview question!).
If you're prepping for interviews or just want to be ready for unexpected scenarios ๐๐ฒ๐๐ ๐๐ต๐ฒ๐บ ๐ผ๐๐ ๐ต๐ฎ๐ป๐ฑ๐-๐ผ๐ป. It really sticks better that way.
Subscribe to my newsletter
Read articles from Vikrant Raut directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Vikrant Raut
Vikrant Raut
Iโm a DevOps engineer who lives in the world of AWS, automation, and cool tech stuff. I spend most of my time building cloud infrastructure, setting up CI/CD pipelines, and making sure things run smooth and fast. But thatโs not allโIโve also got a web development background, so I enjoy jumping into frontend or backend code when needed. You could say Iโm kind of a full-stack problem solver. This blog is where I share things I learn, random tips, tech experiments, and the occasional rant when something breaks at 2 AM. If youโre into DevOps, cloud, or just curious about how things work behind the scenesโwelcome aboard!