Rich-Harris/degit hiện có 7.9k sao trên GitHub, viết chủ yếu bằng TypeScript. Straightforward project scaffolding
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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 the platform-appropriate cache directory if it doesn't already exist locally. On Linux/BSD this follows XDG_CACHE_HOME when set and otherwise uses ~/.cache/degit; on macOS it uses ~/Library/Caches/degit; on Windows it uses %LOCALAPPDATA%\degit. (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
Node.js 20 or later (see engines in package.json)
Bun 1.3.14 when developing this repository (see packageManager in package.json)
End users can still install the published package with npm (npm install -g degit). For a dev clone of this repo, use Bun so the lockfile and bunfig.toml apply; minimumReleaseAge is set to 14 days so installs skip very fresh publishes.
git clone https://github.com/Rich-Harris/degit.git
cd degit
bun install
bun run build
See docs/CONTRIBUTING.md for how to contribute. docs/SECURITY.md explains how to report vulnerabilities. AGENTS.md summarizes setup and commands for tooling and coding agents. When verifying production CLI bugs, reproduce with the published package (for example npx degit@latest ...) rather than running the raw repository source directly. When you change development workflow, CI, or contributor-facing instructions, update README.md, docs/CONTRIBUTING.md, and AGENTS.md together so they stay consistent.
bun run test runs the unit tests in test/unit/**/*.test.ts and the public integration tests in test/integration/public.test.ts, excluding test/integration/private.test.ts. Use bun run test:integration for the integration suite.
bun run perf:ci runs the fixture-backed performance gate that CI uses to catch clone regressions.9
Installation
npm install -g degit
Agent skill
This repository includes a reusable degit skill for agents that support SKILL.md files. Add it using your agent's skill installation flow, 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.
Usage
Basics
The simplest use of degit is to download the default branch of a repo from GitHub to the current working directory:
degit user/repo
# these commands are equivalent
degit github:user/repo
degit [email protected]:user/repo
degit https://github.com/user/repo
GitLab repositories inside nested groups are supported at runtime:
degit gitlab:gitlab-org/frontend/utils#v0.3.4
degit first tries the two-segment user/repo interpretation, so user/repo/subdir still means "clone user/repo and extract subdir". If that combination does not exist, it falls back to treating the path as a nested GitLab group.
HTTPS proxying
If you have an https_proxy environment variable, Degit will use it.
Cache behavior
degit caches downloaded tar snapshots so you don't need to fetch them again. By default, it tries to resolve the latest ref from the network and falls back to the cached version if the network is unreachable. Use --cache (-c) to skip the network request entirely and only use a locally cached copy.
Private repositories
Private repositories are handled automatically. degit uses the tarball path by default for HTTPS sources and falls back to SSH cloning when it cannot fetch or extract a snapshot.
SSH/private repositories still require git on your PATH.
If you still pass --mode=git, degit keeps working and prints a notice that the flag is no longer needed. --mode=tar is the default path.
See all options
degit --help
Pull requests are very welcome!
Wait, isn't this just git clone --depth 1?
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 and offline support (if you already have a .tar.gz file for a specific commit, you don't need to fetch it again).
Less to type (degit user/repo instead of git clone --depth 1 ssh://[email protected]/user/repo)
Composability via actions
Future capabilities — interactive mode, friendly onboarding and postinstall scripts
You can manipulate repositories after they have been cloned with actions, specified in a degit.json file that lives at the top level of the working directory. Currently, there are three actions — clone, search_replace, and remove. Additional actions may be added in future.
A JSON Schema is available for editor autocompletion and validation; map degit.json to it in your editor's JSON schema settings (e.g. VS Code's json.schemas).
This will clone user/another-repo, preserving the contents of the existing working directory. This allows you to, say, add a new README.md or starter file to a repo that you do not control. The cloned repo can contain its own degit.json actions.
This replaces every match of the regular expression in the listed files using the value of the named environment variable. files can be a single path or an array of paths, and each path is resolved relative to the destination. Paths outside the destination are skipped.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/Rich-Harris/degit là nguồn chính thức.
Rich-Harris/degit có phải mã nguồn mở không?
Có — Rich-Harris/degit phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/Rich-Harris/degit.
Rich-Harris/degit có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho Rich-Harris/degit. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
Rich-Harris/degit dùng license gì?
Rich-Harris/degit phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
Rich-Harris/degit là gì?
Rich-Harris/degit (Rich-Harris/degit) là dự án TypeScript trên GitHub. Theo mô tả gốc: Straightforward project scaffolding
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về degit?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về degit.