Skip to main content

A wrapper for git that adds commands for working with GitHub-based projects. If set up as instructed by hub alias, one can use git to run hub commands.

# To clone a repository you own, using just the repository name rather than the full URL:
hub clone <repo_name>

# To clone another user's repository, using their github username and the repository name:
hub clone <username>/<repo_name>

# To create a fork of the current repository (cloned from another user) under your github profile:
hub fork

# To push the current local branch to github and create a PR for it in the original repository:
hub push <remote_name> && hub pull-request

# To create a PR of the current (already pushed) branch, reusing the message from the first commit:
hub pull-request --no-edit

# To create a new branch with the contents of a pull request and switch to it:
hub pr checkout <pr_number>

# To upload the current (local-only) repository to your github account:
hub create