Skip to content

TimoBechtel/gh-get

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

gh-get

gh get downloads a file or directory from a GitHub repository.

Install

gh extension install TimoBechtel/gh-get

Usage

gh 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

About

Download single files from GitHub

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages