
hub
A git wrapper that adds GitHub commands like cloning by repo name and managing pull requests.
- Stars
- 23k
- Forks
- 2.2k
- Licence
- MIT
- Language
- Go
- Last update
- 2.8 years ago
- Type
- CLI
No commits in over a year — check for forks or alternatives before adopting.
What it is
hub is a command-line tool that wraps git and adds extra commands for working with GitHub, such as cloning a repository by its owner/name or handling pull requests from the terminal. It can also be aliased as git so normal git commands still work with the added features. The README notes that GitHub's official CLI, gh, is an alternative.
- Clone a repository with a short owner/name form, for example hub clone rtomayko/tilt
- Switch clone URLs to SSH by setting hub.protocol to ssh in git config
- List open pull requests from the terminal or inside a GitHub Actions workflow
- Write shell scripts that interact with the GitHub API
Great for
- Developers who use git and GitHub daily from the terminal
- People who want git commands to stay familiar while gaining GitHub shortcuts
- Developers writing shell scripts that call the GitHub API
- Teams using GitHub Actions workflows that need to list pull requests
Not ideal for
- People who want the official, actively positioned GitHub CLI: the README points to cli.github.com as the more user-friendly option
- Users who need help with GitHub.com itself: the README says the repo's issue tracker is not for web interface problems
- Anyone who dislikes tools that alias or wrap git, since aliasing changes how the git command behaves in the shell
How to get it
- 1
Install with a package manager
You'll need: git 1.7.3 or newer (recommended)
Install with Homebrew (macOS, Linux)
brew install hubInstall with Scoop (Windows)
scoop install hubInstall with Chocolatey (Windows)
choco install hub - 2
Run it
- Install hub using a package manager from the README table or download a standalone binary
- Run hub version to confirm the install, especially for community-maintained packages
- Optionally add the alias with eval "$(hub alias -s)" in your shell startup file
- Try hub clone with an owner/name repository such as rtomayko/tilt
- 3
Get the most out of it
- Set git config --global hub.protocol ssh so hub clone uses SSH URLs
- Alias hub as git using hub alias -s so git commands gain hub features
- Use the full reference documentation at hub.github.com/hub.1.html to see all commands and flags
- Install tab-completion scripts for bash, zsh, or fish from the etc directory of the repository
Downloads
Strengths
- Keeps familiar git commands while adding GitHub features
- Installs through many package managers and as a standalone binary
- Has no dependencies beyond git 1.7.3 or newer, per the README
Trade-offs
- The README recommends the official gh CLI as a more user-friendly option, so this tool may be less actively promoted
- Some community-maintained packages may lag behind the latest release, as the README warns
- The GitHub Actions example needs a token, and the default token only covers the workflow's own repository
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| hub (this) | 23k | CLI | beginner | 2.8 years ago | Developers who use git and GitHub daily from the terminal |
| git-extras | 18.1k | CLI | beginner | 29 days ago | Developers who already use Git daily and want shortcuts for common repository tasks |
| lazygit | 83.6k | CLI | beginner | 6 days ago | Developers who already use git from the command line and want a faster overview of their repository |
| cli | 46.8k | CLI | beginner | 7 days ago | Developers who already work in the terminal and use GitHub daily |
| gitleaks | 30.6k | CLI | beginner | 10 days ago | Developers who want to catch accidentally committed credentials before they reach a shared repository |
| diff-so-fancy | 18.1k | CLI | beginner | 19 days ago | Developers who review many diffs in the terminal |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.