Clone a git repository without history

• 1 min read

There are many ways to clone a repository without its history.

The cleanest way is, no doubt, starting from fresh by deleting the .git folder and creating a new one with:

rm -rf .git
git init

Nevertheless, for small scaffolding project I use, I’d prefer using this command:

git clone --depth 1 reponame.git