Download A Git Repo

January - 2022

This is a bit of a hack, but to download a git repo into your current directory you can do:

git init 
git remote add origin https://github.com/alanwsmith/ideas.alanwsmith.com
git fetch 
git checkout main
rm -rf .git

The reason you might want to use this over git clone is because you can do it in your current directory. The git clone command clones the repo down into a sub directory.

credit to this post for the technique