degit makes copies of git repositories. When you run degit some-user/some-repo
, it will find the latest commit on https://github.com/some-user/some-repo and download the associated tar file to ~/.degit/some-user/some-repo/commithash.tar.gz
if it doesn't already exist locally. (This is much quicker than using git clone
, because you're not downloading the entire git history.)
You can specify a specific branch, tag or commit hash...
degit some-user/some-repo#some-feature # branch
degit some-user/some-repo#v1.0.0 # tag
degit some-user/some-repo#1234abcd # commit hash
...or create a new folder for the project...
degit some-user/some-repo my-new-project
...and that's it. As simple as possible, and no simpler.
npm install -g degit
- Windows
- Private repositories
- Anything that isn't GitHub
Pull requests are very welcome!
A few salient differences:
- If you
git clone
, you get a.git
folder that pertains to the project template, rather than your project. You can easily forget to re-init the repository, and end up confusing yourself - Caching (if you already have a
.tar.gz
file for a specific commit, you don't need to fetch it again). This will enable offline support soon - Less to type (
degit user/repo
instead ofgit clone --depth 1 [email protected]:user/repo
) - Future capabilities — interactive mode, friendly onboarding and postinstall scripts
MIT.