๐‡๐จ๐ฐ ๐ฐ๐จ๐ฎ๐ฅ๐ ๐ฒ๐จ๐ฎ C๐ฅ๐จ๐ง๐ž ๐š ๐ก๐ฎ๐ ๐ž ๐†๐ข๐ญ๐‡๐ฎ๐› ๐ซ๐ž๐ฉ๐จ ๐ฐ๐ข๐ญ๐ก ๐ญ๐จ๐ง๐ฌ ๐จ๐Ÿ ๐Ÿ๐ข๐ฅ๐ž๐ฌ ๐ฐ๐ข๐ญ๐ก๐จ๐ฎ๐ญ ๐ข๐ญ ๐ญ๐š๐ค๐ข๐ง๐  ๐ก๐จ๐ฎ๐ซ๐ฌ?

Vikrant RautVikrant Raut
1 min read

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.

0
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!