-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithubgo
More file actions
35 lines (31 loc) · 1.29 KB
/
Copy pathgithubgo
File metadata and controls
35 lines (31 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
### git install hub go
## use standalone install https://github.com/github/hub or
## install hub from source -> Go programming language needed | check https://golang.org/doc/
# download a release from https://golang.org/dl/
$ wget https://storage.googleapis.com/golang/go$VERSION.$OS-$ARCH.tar.gz
## extracting archive https://github.com/golang/go/blob/master/README.md
## into /usr/local (through sudo)
$ tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
# add to PATH
$ export PATH=$PATH:/usr/local/go/bin
## to custom location $HOME/gofolder
$ cd ~/gofolder
$ tar -xzf go$VERSION.$OS-$ARCH.tar.gz
# add go/bin to ~/.profile
export GOROOT=$HOME/gofolder
export PATH=$PATH:$GOROOT/bin
## cd to hub installation source folder
$ cd /hub/install/folder
# clone hub from source
$ git clone https://github.com/github/hub.git
$ cd hub
# build to a folder visible by PATH anywhere in ~
$ ./script/build -o ~/bin/hub
# $HOME/bin is added to $PATH by .profile so hub should be set to go
# if you prefere to locate the built file elsewhere you can create a symlink
$ sudo ln -s location/to/my/build/hub /usr/local/bin/hub
# hub shell auto-completion is available by adding to .bashrc
# the script is located in hub/etc folder
if [ -f /path/to/hub.bash_completion ]; then
. /path/to/hub.bash_completion
fi