degit README

The project's README from github.com/Rich-Harris/degit. As one markdown file: README.md.

degit — straightforward project scaffolding

Known Vulnerabilities install size npm package version Contributor Covenant PRs Welcome

degit makes copies of git repositories. When you run degit some-user/some-repo, it finds the latest commit on https://github.com/some-user/some-repo and downloads the associated tar file to the platform-appropriate cache directory if it doesn't already exist locally. (This is much quicker than using git clone, because you're not downloading the entire git history.)

degit resolves refs through an internal git backend, downloads tar snapshots by default, and falls back to SSH cloning when tarball fetches or extraction fail. Public HTTPS sources do not need a local git binary on your PATH, but SSH/private repositories still do.

Requirements

Installation

npm install -g degit

Quick start

Download the default branch of a GitHub repo to the current directory:

degit user/repo

Download to a new folder:

degit user/repo my-new-project
degit -r user/repo

Download only specific files:

degit user/repo my-project --files README.md,src/index.ts

Use a specific tag, branch, or commit:

degit user/repo#v1.0.0

For the full CLI reference, ESM API, and degit.json actions, see docs/USAGE.md.

Why not just git clone --depth 1?

Agent skill

Install the reusable degit skill for agents that support SKILL.md files:

# project-level install
npx skills add Rich-Harris/degit --skill degit

# global install
npx skills add Rich-Harris/degit --skill degit -g

Then ask the agent to download a repository or template. The skill helps it choose a source, ref, and destination; handle private repositories and aliases; and avoid overwriting a non-empty destination without confirmation.

See skills/degit/SKILL.md for the full skill instructions.

Documentation

See also

License

MIT

degit (Rich-Harris/degit)

Searching Database…

7.9K ·GitHub
What is this?degit is a command-line tool that makes copies of git repositories. Run degit some-user/some-repo and it downloads the latest commit's tar file into the current directory — no git history attached, which makes it much quicker than git clone for scaffolding a project from a template.
Why use this instead of git clone --depth 1?It skips the history so downloads are faster, leaves no .git folder behind, and caches tar archives for offline reuse, all with less typing. You also get composable post-clone actions via degit.json plus built-in subdirectory, file-filter, and alias support.
How do I use it?Run degit user/repo to download a repo's default branch into the current directory, or give it a second argument to land the copy in a new folder. You can also pin a specific tag, branch, or commit as the source.
What do I need installed to run it?Node.js 20 or later. Public HTTPS sources work without a local git binary, but SSH and private repositories still need git on your PATH — and degit falls back to SSH cloning if a tarball fetch or extraction fails.
Where do downloaded copies end up?Tar snapshots are saved to a platform-appropriate cache directory and reused if they already exist locally, so downloading the same template again doesn't re-fetch it from the network.
What can degit.json do?It defines composable actions that run after the copy. The full set of actions, along with the complete CLI reference and the ESM API, is documented in docs/USAGE.md.
What happens if the destination folder already has files?The README doesn't spell out the CLI's behavior for that case, but the bundled agent skill is explicitly written to avoid overwriting a non-empty destination without confirmation.
Are there similar tools worth knowing about?The README's see-also section lists zel by Vu Tran, gittar by Luke Edwards, and gitpick by Neeraj Dalal as related projects.
Size
1 MB
Stars
7.9K
Age
9y
Commits · 90 Days