Download files, folders, or entire repos from GitHub URLs using the gitload CLI.
Use gitload when:
Do NOT use gitload when:
git clone instead)Run gitload via npx (no install needed):
npx gitload-cli https://github.com/user/repo
Or install globally:
npm install -g gitload-cli
gitload https://github.com/user/repo
Creates a repo/ folder in the current directory.
gitload https://github.com/user/repo/tree/main/src/components
Creates a components/ folder with just that folder's contents.
gitload https://github.com/user/repo/blob/main/README.md
gitload https://github.com/user/repo/tree/main/src -o ./my-source
gitload https://github.com/user/repo/tree/main/templates -o .
gitload https://github.com/user/repo -z ./repo.zip
gitload https://github.com/user/private-repo --gh
Requires prior gh auth login.
gitload https://github.com/user/repo --token ghp_xxxx
export GITHUB_TOKEN=ghp_xxxx
gitload https://github.com/user/repo
Token priority: --token > GITHUB_TOKEN > --gh
gitload accepts standard GitHub URLs:
https://github.com/user/repohttps://github.com/user/repo/tree/branch/path/to/folderhttps://github.com/user/repo/blob/branch/path/to/file.extgitload https://github.com/org/templates/tree/main/react-starter -o ./my-app
cd my-app && npm install
gitload https://github.com/org/examples/tree/main/authentication
gitload https://github.com/org/project/tree/main/docs -z ./docs.zip
gitload https://github.com/org/configs/blob/main/.eslintrc.json -o .
| Option | Description |
|---|---|
| -------- | ------------- |
-o, --output | Output directory (default: folder named after URL path) |
-z, --zip | Save as ZIP file at the specified path |
-t, --token | GitHub personal access token |
--gh | Use token from gh CLI |
--no-color | Disable colored output |
-h, --help | Display help |
-V, --version | Output version |
If gitload fails:
--gh or --tokenrepo scopegit clone if history is needed)共 2 个版本