TopGit
GitHub Repo Review

hub: A Git Wrapper for GitHub Workflows

mislav/hub
HTopGit review image for mislav/hub
Review by Topgit.dev for mislav/hub, with GitHub repository stats and README context.
Quick verdict

hub still does exactly what it always did: hub clone, hub pull-request, and its other GitHub shortcuts run without a hitch, and aliasing it as git hasn't gotten any riskier. What's changed is the alternative — GitHub's own gh CLI covers the same ground with first-party API support, and hub's README sends newcomers straight to it. That's the real signal: a project pointing readers to its likely successor is worth trusting on that call.

Stars
★ 23.0k
Forks
⑂ 2.2k
Contributors
👥 252
Language
Go
License
MIT
Topic
Developer Tools
Updated
Feb 2024
Homepage
GitHub

What hub is and what it does

hub is a command-line tool that wraps git to add GitHub-aware commands — cloning by owner/repo shorthand, opening pull requests, scripting against the GitHub API — on top of your existing git binary. It doesn't replace git. The README says hub can be safely aliased as git, so ordinary git commands keep working exactly as before while hub's extras ride along underneath.

Core features: commands hub adds to git

  • ✓hub clone owner/repo expands to the full git clone URL automatically, using SSH if you've set git config --global hub.protocol ssh.
  • ✓Can be aliased as git via eval "$(hub alias -s)" in your shell startup file — the README says this doesn't break normal git commands.
  • ✓Scriptable against the GitHub API directly from shell scripts.
  • ✓Ships shell completion scripts for bash, zsh, and fish in the repo's etc/ folder.
  • ✓Works inside GitHub Actions out of the box — the README's example runs hub pr list using the default GITHUB_TOKEN secret.
  • ✓No runtime dependencies once installed; it only expects git 1.7.3 or newer on the system.
How this repository's GitHub stars have grown over time. Source: star-history.com.View the star history ↗

Installing hub on your system

On macOS or Linux, brew install hub via Homebrew is the path the README leads with; nix-env -i hub works too if you're on Nix. Windows users get scoop install hub or choco install hub. Linux distros each have their own package: sudo dnf install hub on Fedora, sudo pacman -S hub on Arch, sudo apt install hub on Debian/Ubuntu, sudo zypper install hub on openSUSE, sudo xbps-install -S hub on Void Linux, and sudo emerge dev-vcs/hub on Gentoo. FreeBSD has pkg install hub, and conda install -c conda-forge hub works anywhere conda does. The README is explicit that only the Homebrew package is guaranteed to track the latest release — everything else is community-maintained, so check hub version after installing. It also flags the Ubuntu Snap package as one it no longer recommends. If none of those fit, download the standalone binary from the latest release and drop it in your PATH, or build from source: clone the repo, then run make install prefix=/usr/local with Go 1.11+ and make installed. The only real dependency is git itself.

Using hub commands with examples

The README's own example is hub clone rtomayko/tilt, which expands to git clone https://github.com/rtomayko/tilt.git — set git config --global hub.protocol ssh first if you want the SSH form instead. Once eval "$(hub alias -s)" runs in your shell startup file, you type git the way you always have and hub quietly extends commands like pull-request and browse. In GitHub Actions, the README's sample workflow checks out the repo with actions/checkout@v2 and then runs hub pr list with GITHUB_TOKEN pulled from secrets — that default token only covers the repo the workflow runs in, so operating on other repos in a CI/CD pipeline needs a personal access token with repo scope added as its own secret. Full command and flag references live outside this repo, on hub's own documentation site.

Strengths

  • ✓Aliasing as git is low-risk — the README states normal git commands keep working unchanged, so you're not learning a second tool.
  • ✓hub clone owner/repo shorthand removes the copy-paste step of building a full GitHub clone URL by hand.
  • ✓Drops into GitHub Actions workflows without extra setup, using the same GITHUB_TOKEN secret Actions already provides.
  • ✓MIT-licensed, so there's no ambiguity about using it in commercial tooling.

Limitations and known issues

  • △hub's own README sends newcomers to GitHub's official gh CLI and links a comparison doc — that's the project pointing at its likely successor, not a neutral aside.
  • △Packages outside Homebrew are community-maintained and, per the README, not guaranteed to match the latest hub release, so version drift is a real risk on non-Homebrew installs.
  • △Building from source requires Go 1.11+ and make — there's no simpler build path documented for contributors.
  • △The Ubuntu Snap package is explicitly flagged in the README as one the maintainers no longer recommend.

hub vs GitHub CLI (gh)

git — many hub commands are just convenience wrappers around URLs and API calls you can already do with plain git plus the GitHub web UI, if you don't need the shortcuts. ↗GitHub CLI (gh) — GitHub's official command-line tool; hub's own README recommends it as a more user-friendly official option and links a direct comparison.

Frequently asked questions

Is hub still maintained or should I use GitHub CLI instead?

hub still works and its commands like hub clone and hub pull-request run fine, but hub's own README points newcomers to GitHub's official gh CLI and links a comparison doc, so treat hub as legacy-but-functional rather than the recommended starting point.

How do I install hub on Windows using Scoop or Chocolatey?

On Windows, install hub with scoop install hub if you use Scoop, or choco install hub if you use Chocolatey. Both are community-maintained packages, so run hub version afterward to confirm you got the release you expected.

Can hub be safely aliased as git without breaking normal git commands?

Aliasing hub as git is safe, according to hub's own README — normal git commands keep working unchanged after running eval "$(hub alias -s)" in your shell startup file; hub only layers extra behavior on top.

What git version is required to use hub?

hub recommends git 1.7.3 or newer, per its README — the hub executable itself has no other runtime dependencies, so that git version is effectively the only prerequisite.

Does hub work with GitHub Actions and how do I set GITHUB_TOKEN?

hub works in GitHub Actions — the README's example workflow checks out the repo, then runs hub pr list with GITHUB_TOKEN read from secrets.GITHUB_TOKEN, which Actions provides by default. That default token only covers the repo running the workflow, so reaching other repos needs a personal access token with repo scope stored as a secret.

How do I build hub from source using Go?

Building hub from source needs make and Go 1.11+, per the README. Clone the repository, cd into it, then run make install prefix=/usr/local — that compiles hub and installs the binary to the given prefix.

The problem it solves

Typing out full GitHub clone URLs, remembering the right flags to open a pull request from the CLI, or wiring GITHUB_TOKEN into a script by hand is exactly the friction hub targets — it sits between git and the GitHub web UI so those specific actions become one command instead of a copy-paste trip to the browser.

Best use cases

  • •Cloning a repo by owner/repo shorthand instead of typing the full GitHub URL.
  • •Opening or listing pull requests from the terminal during code review.
  • •Running hub pr list inside a GitHub Actions workflow to check PR state as part of CI.
  • •Writing shell scripts that call the GitHub API without a separate HTTP client.

Who should try it — and who should skip

Developers who already have hub aliased into their shell and don't want to relearn muscle memory should keep using it — the README's own aliasing instructions mean the switch cost to drop it is near zero, but so is the cost of staying. Anyone setting up a new machine or a new CI pipeline should read hub's README pointer to GitHub CLI (gh) first and decide from the comparison doc it links, rather than defaulting to hub out of habit.

Related repositories

Source & attribution

Facts and quotes are sourced from the mislav/hub GitHub repository and its README.

GitHub data · last synced Aug 15, 2026Reviewed by Henry
← Back to TopGit

Still deciding about hub?

One click hands the question to an AI along with this page — see what it says about hub.

GitHub