gh get downloads a file or directory from a GitHub repository.
gh extension install TimoBechtel/gh-getgh get <owner/repo> <path/in/repo> [--ref <ref>] [output]If you pass just <repo>, gh get uses your authenticated GitHub username as owner.
Use -f or --force to overwrite existing files.
Use --ref to select a branch, tag, or commit (default: main).
Use @alias to resolve a path from .gh-get.json in the target repo at the selected ref.
Alias names must match: [a-zA-Z0-9_-]+.
.gh-get.json format:
{
"aliases": {
"mac": "Global/macOS.gitignore"
}
}Examples:
gh get github/gitignore README.md
gh get github/gitignore Global/macOS.gitignore --ref main .gitignore
gh get owner/repo @mac
gh get --help