README.md 3.3 KB
Newer Older
M
Mislav Marohnić 已提交
1 2
git + hub = github
==================
C
readme  
Chris Wanstrath 已提交
3

M
Mislav Marohnić 已提交
4 5
hub is a command line tool that wraps `git` in order to extend it with extra
features and commands that make working with GitHub easier.
C
readme  
Chris Wanstrath 已提交
6

7
``` sh
M
Mislav Marohnić 已提交
8
$ hub clone rtomayko/tilt
C
readme  
Chris Wanstrath 已提交
9

M
Mislav Marohnić 已提交
10 11
# expands to:
$ git clone git://github.com/rtomayko/tilt.git
12
```
C
Chris Wanstrath 已提交
13

M
Mislav Marohnić 已提交
14 15
hub is best aliased as `git`, so you can type `$ git <command>` in the shell and
get all the usual `hub` features. See "Aliasing" below.
C
tweak  
Chris Wanstrath 已提交
16

J
Joe Lanman 已提交
17 18 19 20 21
Usage documentation
------------

https://hub.github.com/hub.1.html

C
Chris Wanstrath 已提交
22

M
Mislav Marohnić 已提交
23 24
Installation
------------
C
Chris Wanstrath 已提交
25

M
Mislav Marohnić 已提交
26
Dependencies:
C
Chris Wanstrath 已提交
27

M
Mislav Marohnić 已提交
28
* **git 1.7.3** or newer
C
tweak  
Chris Wanstrath 已提交
29

30 31
#### Homebrew

K
Keshav Goyal 已提交
32
`hub` can be installed through [Homebrew](https://docs.brew.sh/Installation) on macOS:
33

34
``` sh
35 36 37
$ brew install hub
$ hub version
git version 1.7.6
38 39 40
hub version 2.2.3
```

M
Mislav Marohnić 已提交
41
#### Windows
42

M
Mislav Marohnić 已提交
43 44
`hub` can be installed through [Chocolatey](https://chocolatey.org/) or
[Scoop](http://scoop.sh/) on Windows:
45 46 47

``` sh
> choco install hub
M
Mislav Marohnić 已提交
48
# or:
49
> scoop install hub
50
```
51

52 53 54 55 56 57 58 59 60 61 62
#### Fedora Linux

On Fedora you can install `hub` through DNF:

``` sh
$ sudo dnf install hub
$ hub version
git version 2.9.3
hub version 2.2.9
```

63 64 65 66 67
#### Arch Linux

On Arch Linux you can install `hub` from official repository:

```sh
M
Mislav Marohnić 已提交
68
$ sudo pacman -S hub
69 70
```

O
Owen Ou 已提交
71 72
#### Standalone

73
`hub` can be easily installed as an executable. Download the latest
74 75
[compiled binaries](https://github.com/github/hub/releases) and put it anywhere
in your executable path.
O
Owen Ou 已提交
76 77 78

#### Source

79
With your [GOPATH](https://github.com/golang/go/wiki/GOPATH) already set up:
O
Owen Ou 已提交
80

M
Mislav Marohnić 已提交
81
``` sh
82 83
$ go get github.com/github/hub
$ cd "$GOPATH"/src/github.com/github/hub
M
Mislav Marohnić 已提交
84 85
$ make install prefix=/usr/local
```
O
Owen Ou 已提交
86

M
Marcio Puga 已提交
87
Prerequisites for compilation are:
M
Mislav Marohnić 已提交
88

M
Mislav Marohnić 已提交
89
* `make`
P
Pepper Lebeck-Jobe 已提交
90
* [Go 1.8+](http://golang.org/doc/install)
M
Mislav Marohnić 已提交
91 92
* Ruby 1.9+ with Bundler - for generating man pages

C
Chris Wanstrath 已提交
93 94
Aliasing
--------
C
readme  
Chris Wanstrath 已提交
95

M
Mislav Marohnić 已提交
96 97
Using hub feels best when it's aliased as `git`. This is not dangerous; your
_normal git commands will all work_. hub merely adds some sugar.
C
readme  
Chris Wanstrath 已提交
98

99 100
`hub alias` displays instructions for the current shell. With the `-s` flag, it
outputs a script suitable for `eval`.
C
Chris Wanstrath 已提交
101

102
You should place this command in your `.bash_profile` or other startup script:
C
Chris Wanstrath 已提交
103

104
``` sh
105
eval "$(hub alias -s)"
106
```
C
tweaks  
Chris Wanstrath 已提交
107

108 109
#### PowerShell

P
Pepper Lebeck-Jobe 已提交
110 111
If you're using PowerShell, you can set an alias for `hub` by placing the
following in your PowerShell profile (usually
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
`~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1`):

``` sh
Set-Alias git hub
```

A simple way to do this is to run the following from the PowerShell prompt:

``` sh
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:

``` sh
New-Item -Type file -Force $PROFILE
```

132 133
### Shell tab-completion

134 135
hub repository contains tab-completion scripts for bash, zsh and fish.
These scripts complement existing completion scripts that ship with git.
136

137 138
[Installation instructions](etc)

M
Mislav Marohnić 已提交
139 140
* [hub bash completion](https://github.com/github/hub/blob/master/etc/hub.bash_completion.sh)
* [hub zsh completion](https://github.com/github/hub/blob/master/etc/hub.zsh_completion)
M
Michihito Shigemura 已提交
141
* [hub fish completion](https://github.com/github/hub/blob/master/etc/hub.fish_completion)
142

C
Chris Wanstrath 已提交
143 144
Meta
----
C
readme  
Chris Wanstrath 已提交
145

M
Mislav Marohnić 已提交
146 147 148
* Home: <https://github.com/github/hub>
* Bugs: <https://github.com/github/hub/issues>
* Authors: <https://github.com/github/hub/contributors>