Use standalone install or
-> Go programming language needed
$ wget https://storage.googleapis.com/golang/go$VERSION.$OS-$ARCH.tar.gz
find a suitable version on golang page or on ubuntu packages
-
To custom location
$HOME/gofolder
$ cd ~/gofolder
$ tar -xzf go$VERSION.$OS-$ARCH.tar.gzadd go/bin to ~/.profile
export GOROOT=$HOME/gofolder export PATH=$PATH:$GOROOT/bin
- or through sudo into
/usr/local
$ tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gzadd to PATH
$ export PATH=$PATH:/usr/local/go/bin
$ cd /hub/install/folder
$ git clone https://github.com/github/hub.git
$ cd hub
anywhere in ~
$ ./script/build -o ~/bin/hub
$HOME/bin is added to $PATH by ~/.profile so hub should be set to go
if you'd prefer to locate the built file elsewhere you can create a symlink
$ sudo ln -s location/to/my/build/hub /usr/local/bin/hub
The script hub.bash_completion.sh is located in hub/etc folder. Adding the block below into ~/.bashrc enables the auto-completion
if [ -f /path/to/hub.bash_completion ]; then
. /path/to/hub.bash_completion
fi