hub
Interact with GitHub from the command line
TLDR
Clone a repository using its slug (owners can omit the username)
Create a fork of the current repository (cloned from another user) under your GitHub profile
Push the current local branch to GitHub and create a PR for it in the original repository
Create a PR of the current (already pushed) branch, reusing the message from the first commit
Create a new branch with the contents of a pull request and switch to it
Upload the current (local-only) repository to your GitHub account
Fetch Git objects from upstream and update local branches
SYNOPSIS
hub [<global-options>] <command> [<args>]
PARAMETERS
alias
Prints shell alias for git=hub
api
Makes arbitrary HTTP requests to GitHub API
browse [-u]
Opens repository or issue in browser
clone [-p]
Clones public/private repos with user/org support
compare [-u]
Shows commit diff between refs
create [-p -o -d]
Creates a pull request from current branch
fork [-o]
Forks repository to user account
issue
Manages GitHub issues (list, create, show)
pr
Manages pull requests (alias for pull-request)
pull-request
Creates and manages pull requests
release
Manages repository releases
search
Searches GitHub repositories or code
DESCRIPTION
Hub is a lightweight command-line tool that enhances git with GitHub-specific features, allowing seamless interaction with GitHub repositories from the terminal. It acts as a proxy for git, automatically adding functionality like creating pull requests, managing issues, forking repos, and browsing without switching to a web browser.
Designed as a drop-in git replacement, alias git to hub via eval "$(hub alias)" to enable commands like git create (creates a PR), git pr list, or git browse (opens GitHub page). Hub respects existing git remotes and configs, supports OAuth authentication, and provides shortcuts for common workflows.
Popular for its simplicity and integration, hub streamlines GitHub tasks for developers, reducing context switches. Key commands include clone (smart repo cloning), create/pr (pull requests), issue (track issues), and compare (diff branches). While powerful, it's been superseded by the official GitHub CLI.
CAVEATS
Hub is no longer actively maintained (last release 2021). GitHub recommends migrating to the official gh CLI for new features and support.
SETUP
Run eval "$(hub alias)" or add to ~/.bashrc for git replacement. Authenticate via hub auth login or GITHUB_TOKEN env.
INSTALLATION
Linux: curl -fsSL https://github.com/github/hub/raw/master/script/get.sh | bash or package managers like apt/brew.
HISTORY
Created in 2011 by Chris Wanstrath (defunkt) as an open-source git extension for GitHub. Gained widespread use in developer communities for CLI PR/issue management. Maintained until 2021, when GitHub launched the official gh CLI, prompting deprecation.


