Skip to content
Skillpedia
General coding8.0k · #12654

degit

What it does

Shows how to copy a project template or repository snapshot into a new folder with degit, without the full git history. It is for developers who want to start a project quickly from a template.

When to use it

  • ✓When a developer wants to start a new project from a GitHub or GitLab template.
  • ✓When a developer wants a copy of a repository without its git history.
  • ✓When a developer wants only certain files or folders from a repository.

Skill link

https://github.com/Rich-Harris/degit/blob/master/skills/degit/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/Rich-Harris/degit/blob/master/skills/degit/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“I want to start a new project from a starter template on GitHub. Help me copy it.”

5 new skills a week. 1 minute to read.

How it works

The skill gives the command to copy a repository snapshot into a folder, and helps with branches and subfolders. It works with GitHub, GitLab, Bitbucket, Sourcehut and Gists.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Help the user scaffold a project with degit. Use npx degit@latest unless they have installed degit globally.

Start with the smallest command that matches their request:

npx degit@latest user/repo
npx degit@latest user/repo my-project
npx degit@latest user/repo#branch my-project

Sources can be GitHub (user/repo, github:user/repo, or a GitHub URL), GitLab (gitlab:user/repo, a GitLab URL, or gitlab://host/user/repo), Bitbucket (bitbucket:user/repo or URL), Sourcehut (git.sr.ht/user/repo, SSH form, or URL), or Gist (https://gist.github.com/<id>, https://gist.github.com/<user>/<id>, git@gist.github.com:<id>.git, or ssh://git@gist.github.com/<id>). A #ref can name a branch, tag, or commit. A source may include a subdirectory path.

  • The destination defaults to the current directory and must be empty. Do not suggest --force unless the user explicitly wants to overwrite its contents.
  • Use --cache to require a cached copy (no network). Without --cache, degit tries the network first and falls back to the cached copy if the network is unreachable. Use --verbose to diagnose failures. --mode=git still works but is unnecessary; tar snapshots are the default.
  • Use --files <paths> or -F <paths> to clone only specific files or directories; separate multiple paths with commas or repeat the flag.
  • Private repositories are handled automatically, with SSH fallback when needed. SSH/private use requires git on PATH and working repository credentials.
  • For reusable shortcuts, use degit alias <repo> <name>, then degit <name>; use degit ls and degit unalias <name> to manage aliases.
  • If a template needs post-download changes, explain that its top-level degit.json can use clone, search_replace, and remove actions. search_replace uses a named environment variable for its replacement value.
  • A downloaded degit.json runs automatically and is template-controlled. For untrusted templates, prefer --no-actions to skip actions, or --allow-env <names> to limit which environment variables search_replace may read.

If source, ref, destination, or whether the destination is empty is unknown, ask before giving a potentially destructive command.

FAQ

Does the copy include the git history?

No. The skill describes degit as copying a snapshot, so the history is not included.

Can I copy only some files?

Yes. The skill explains how to copy only specific files or folders.

Can I use it in a folder that already has files?

The skill says the destination must be empty, and it does not suggest forcing an overwrite unless you really want that.

Details

Original description by the author

Download a repository snapshot or template with degit

repo: Rich-Harris/degit

Popularity

GitHub stars
8.0k
Ranking position
#12654
License
MIT
Updated
10/21/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

Similar skills