
rich-harris/degit
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
単純なプロジェクトの足場構築
概要
gitリポジトリのコピーを作成します。degit some-user/some-repoを実行すると、https://github.com/some-user/some-repoの最新のコミットを見つけ、ローカルに存在していなければプラットフォームに適したキャッシュディレクトリにタグファイルをダウンロードします。Linux/BSDでは設定時XDG_CACHE_HOMEこれに従い、それ以外は~/.cache/degitを使用します。macOSでは~/Library/Caches/degitを使い、Windowsでは%LOCALAPPDATA%\degitを使用します。(git cloneを使うよりはるかに速いです。なぜなら、gitの履歴全体をダウンロードしないためです。)degitは内部gitバックエンドを通じてrefを解決し、tar snapshotsはデフォルトでダウンロードし、tarballの取得や解凍に失敗するとSSHクローンにフォールバックします。公開HTTPSソースはPATH上でローカルgitバイナリを必要としませんが、SSH/privateリポジトリは依然として必要です。 - Node.js以降(package.jsonのエンジン参照) - このリポジトリを開発する際のBun(パッケージ内のpackageManagerを参照)。
概要(AI 翻訳)
degitはgitリポジトリのコピーを作成します。degit some-user/some-repoを実行すると、https://github.com/some-user/some-repoの最新のコミットを見つけ、ローカルに存在していなければプラットフォームに適したキャッシュディレクトリにタグファイルをダウンロードします。(これはgit cloneを使うよりもはるかに速いです。なぜなら、gitの履歴全体をダウンロードしなくて済むからです。)
degitは内部gitバックエンドを通じてrefを解決し、デフォルトでtarスナップショットをダウンロードし、tarballの取得や抽出に失敗するとSSHクローンにフォールバックします。公開HTTPSソースは[PATH]にローカルのgitバイナリを必要としませんが、SSH/プライベートリポジトリは依然として必要です。
要件
- Node.js 20以降(
package.jsonのengines参照)
設置
クイックスタート
GitHubリポジトリのデフォルトブランチを現在のディレクトリにダウンロードします:
新しいフォルダへのダウンロード:
特定のファイルのみダウンロードしてください:
特定のタグ、ブランチ、またはコミットを使います:
CLIの完全な参照、ESM API、およびdegit.jsonアクションについては、docs/USAGE.mdをご覧ください。
なぜ単にgit clone --depth 1しないの?
- テンプレートから余った
.gitフォルダーはありません。 - オフライン再利用のためにtarアーカイブをキャッシュします。
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
degit — straightforward project scaffolding
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
- Node.js 20 or later (see
enginesinpackage.json)
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?
- No leftover
.gitfolder from the template. - Caches tar archives for offline reuse.
- Less to type (
degit user/repoversusgit clone --depth 1 ...). - Composable post-clone actions via
degit.json. - Built-in support for subdirectories, file filtering, and aliases.
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
- docs/USAGE.md — full CLI reference, ESM API, and
degit.jsonactions - docs/CONTRIBUTING.md — contributing, development setup, and CI checks
- docs/SECURITY.md — security policy and reporting process
推奨ツール
別のキーワードを試すか、フィルタを外してください。
インストール
npx skillfish add rich-harris/degit