Farzin.io

Farzin.io
cover
Degit, Clone It, Use It, Pretend You Wrote It Yourself

Published on 4/24/2026

Degit, Clone It, Use It, Pretend You Wrote It Yourself

Clone repos without the baggage. No history, no drama.

GitBashNpm

We've all been there. You find a great starter template or a boilerplate repo on GitHub, and all you want is the files, not the entire commit history of someone else's 3 AM debugging sessions.

So you run git clone, wait for it to finish, then manually delete the .git folder like some kind of animal.

There had to be a better way.

The Problem

I was setting up a new project and needed to clone a repository without its Git history — just a clean copy of the files, ready to go. No baggage, no 200 commits about "fixing typos" and "final final FINAL version."

Sure, you can do:

git clone --depth 1 <repo-url> rm -rf .git

But that's two commands and it still downloads more than you need. Felt wrong.

hard choice

Enter Degit

Degit is a tiny tool by Rich Harris (yes, the Svelte guy) that does exactly one thing and does it beautifully:

Clone a repository without its Git history.

That's it. No commits, no refs, no .git folder. Just the files.

How to Use It

Install it globally:

npm install -g degit
or use it with npx for no installation mode

Then clone any repo:

degit user/repo my-new-project

You can also target a specific branch, tag, or commit:

degit user/repo#main degit user/repo#v1.2.0 degit user/repo#abc1234

And it works with GitHub, GitLab, Bitbucket, and even self-hosted instances. No extra config needed.

Why It's Great

  • Fast — It downloads a tarball instead of cloning, so it's significantly quicker
  • Clean — No .git folder, no history, just your files
  • Simple — One command, zero ceremony
  • Flexible — Supports branches, tags, subdirectories

When Should You Use It?

DeGit shines when you:

  • Want to use a template or boilerplate without inheriting its history
  • Are scaffolding a new project from an existing repo
  • Don't need version control from the source — only your own from scratch
  • Want the fastest possible way to grab files from a remote repo

Conclusion

Sometimes the best tools are the ones that solve exactly one problem, with zero fuss.
DeGit is one of those tools. If you've ever deleted a .git folder manually, you owe it to yourself to install this right now.
npm install -g degit

Your future self — the one not manually removing Git folders at midnight — will thank you.

Share this post