- Notifications
You must be signed in to change notification settings - Fork2.2k
A command-line tool that makes git easier to use with GitHub.
License
mislav/hub
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
hub is a command line tool that wrapsgit
in order to extend it with extrafeatures and commands that make working with GitHub easier.
For an official, potentially more user-friendly command-line interface to GitHub,seecli.github.com andthis comparison.
This repository and its issue tracker isnot for reporting problems withGitHub.com web interface. If you have a problem with GitHub itself, pleasecontact Support.
$ hub clone rtomayko/tilt#=> git clone https://github.com/rtomayko/tilt.git# or, if you prefer the SSH protocol:$ git config --global hub.protocol ssh$ hub clone rtomayko/tilt#=> git clone git@github.com:rtomayko/tilt.git
Seeusage examples or thefull referencedocumentation to see all available commandsand flags.
hub can also be used to make shell scripts thatdirectly interact with theGitHub API.
hub can be safelyaliased asgit
, so you can type$ git <command>
in the shell and have it expanded withhub
features.
Thehub
executable has no dependencies, but since it was designed to wrapgit
, it's recommended to have at leastgit 1.7.3 or newer.
platform | manager | command to run |
---|---|---|
macOS, Linux | Homebrew | brew install hub |
macOS, Linux | Nix | nix-env -i hub |
Windows | Scoop | scoop install hub |
Windows | Chocolatey | choco install hub |
Fedora Linux | DNF | sudo dnf install hub |
Arch Linux | pacman | sudo pacman -S hub |
FreeBSD | pkg(8) | pkg install hub |
Debian, Ubuntu | apt(8) | sudo apt install hub |
Ubuntu | Snap | We do not recommend installing the snap anymore. |
openSUSE | Zypper | sudo zypper install hub |
Void Linux | xbps | sudo xbps-install -S hub |
Gentoo | Portage | sudo emerge dev-vcs/hub |
any | conda | conda install -c conda-forge hub |
Packages other than Homebrew are community-maintained (thank you!) and theyare not guaranteed to match thelatest hub release. Checkhub version
after installing a community package.
hub
can be easily installed as an executable. Download thelatestbinary for your system and put it anywhere in your executable path.
hub is ready to be used in yourGitHub Actions workflows:
steps:-uses:actions/checkout@v2-name:List open pull requestsrun:hub pr listenv:GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}
Note that the defaultsecrets.GITHUB_TOKEN
will only work for API operationsscoped to the repository that runs this workflow. If you need to interact with otherrepositories,generate a Personal Access Token with at least therepo
scopeand add it to yourrepository secrets.
Prerequisites for building from source are:
make
- Go 1.11+
Clone this repository and runmake install
:
git clone \ --config transfer.fsckobjects=false \ --config receive.fsckobjects=false \ --config fetch.fsckobjects=false \ https://github.com/github/hub.gitcd hubmake install prefix=/usr/local
Some hub features feel best when it's aliased asgit
. This is not dangerous; yournormal git commands will all work. hub merely adds some sugar.
hub alias
displays instructions for the current shell. With the-s
flag, itoutputs a script suitable foreval
.
You should place this command in your.bash_profile
or other startup script:
eval"$(hubalias -s)"
If you're using PowerShell, you can set an alias forhub
by placing thefollowing in your PowerShell profile (usually~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1
):
Set-Alias git hub
A simple way to do this is to run the following from the PowerShell prompt:
Add-Content$PROFILE"`nSet-Alias git hub"
Note: You'll need to restart your PowerShell console in order for the changes to be picked up.
If your PowerShell profile doesn't exist, you can create it by running the following:
New-Item -Type file -Force$PROFILE
hub repository containstab-completion scripts for bash, zsh and fish.These scripts complement existing completion scripts that ship with git.
About
A command-line tool that makes git easier to use with GitHub.
Topics
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.