hub.1 5.6 KB
Newer Older
C
Chris Wanstrath 已提交
1 2
.\" generated with Ronn/v0.4.1
.\" http://github.com/rtomayko/ronn/
R
Ryan Tomayko 已提交
3
.
S
Stephen Celis 已提交
4
.TH "HUB" "1" "March 2010" "DEFUNKT" "Git Manual"
R
Ryan Tomayko 已提交
5 6 7 8 9
.
.SH "NAME"
\fBhub\fR \-\- git + hub = github
.
.SH "SYNOPSIS"
C
Chris Wanstrath 已提交
10
\fBhub\fR \fICOMMAND\fR \fIOPTIONS\fR
C
0.3.1  
Chris Wanstrath 已提交
11 12
.
.br
C
Chris Wanstrath 已提交
13
\fBhub alias\fR [\fB\-s\fR] \fISHELL\fR
C
0.3.1  
Chris Wanstrath 已提交
14 15
.
.br
R
Ryan Tomayko 已提交
16 17
.
.P
C
Chris Wanstrath 已提交
18
\fBgit init \-g\fR \fIOPTIONS\fR
C
0.3.1  
Chris Wanstrath 已提交
19 20
.
.br
C
Chris Wanstrath 已提交
21
\fBgit clone\fR [\fB\-p\fR] \fIOPTIONS\fR [\fIUSER\fR/]\fIREPOSITORY\fR \fIDIRECTORY\fR
C
0.3.1  
Chris Wanstrath 已提交
22 23
.
.br
C
Chris Wanstrath 已提交
24
\fBgit remote add\fR [\fB\-p\fR] \fIOPTIONS\fR \fIUSER\fR[/\fIREPOSITORY\fR]
C
0.3.1  
Chris Wanstrath 已提交
25 26
.
.br
C
Chris Wanstrath 已提交
27
\fBgit browse\fR [\fB\-p\fR] [\fIUSER\fR/]\fIREPOSITORY\fR
C
0.3.1  
Chris Wanstrath 已提交
28 29
.
.br
C
Chris Wanstrath 已提交
30
\fBgit submodule add\fR [\fB\-p\fR] \fIOPTIONS\fR [\fIUSER\fR/]\fIREPOSITORY\fR \fIDIRECTORY\fR
R
Ryan Tomayko 已提交
31 32 33 34 35 36
.
.SH "DESCRIPTION"
\fBhub\fR enhances various \fBgit\fR commands with GitHub remote expansion. The
alias command displays information on configuring your environment:
.
.TP
C
Chris Wanstrath 已提交
37 38 39
\fBhub alias\fR [\fB\-s\fR] \fISHELL\fR
Writes shell aliasing code for \fISHELL\fR (\fBbash\fR, \fBsh\fR, \fBzsh\fR, \fBcsh\fR) to standard output. With the \fB\-s\fR option, the output of
this command can be evaluated directly within the shell: \fBeval $(hub alias \-s bash)\fR
R
Ryan Tomayko 已提交
40 41 42 43 44
.
.P
After configuring the alias, the following commands have superpowers:
.
.TP
C
Chris Wanstrath 已提交
45
\fBgit init\fR \fB\-g\fR \fIOPTIONS\fR
R
Ryan Tomayko 已提交
46
Create a git repository as with git\-init(1) and add remote \fBorigin\fR at
47
"git@github.com:\fIUSER\fR/\fIREPOSITORY\fR.git"; \fIUSER\fR is your GitHub username and \fIREPOSITORY\fR is the current working directory's basename.
R
Ryan Tomayko 已提交
48 49
.
.TP
C
Chris Wanstrath 已提交
50
\fBgit clone\fR [\fB\-p\fR] \fIOPTIONS\fR [\fIUSER\fR\fB/\fR]\fIREPOSITORY\fR \fIDIRECTORY\fR
C
Chris Wanstrath 已提交
51
Clone repository "git://github.com/\fIUSER\fR/\fIREPOSITORY\fR.git" into \fIDIRECTORY\fR as with git\-clone(1). When \fIUSER\fR/ is omitted, assumes
C
Chris Wanstrath 已提交
52
your GitHub login. With \fB\-p\fR, use private remote
C
Chris Wanstrath 已提交
53
"git@github.com:\fIUSER\fR/\fIREPOSITORY\fR.git".
R
Ryan Tomayko 已提交
54 55
.
.TP
C
Chris Wanstrath 已提交
56
\fBgit remote add\fR [\fB\-p\fR] \fIOPTIONS\fR \fIUSER\fR[\fB/\fR\fIREPOSITORY\fR]
57 58
Add remote "git://github.com/\fIUSER\fR/\fIREPOSITORY\fR.git" as with
git\-remote(1). When /\fIREPOSITORY\fR is omitted, the basename of the
C
Chris Wanstrath 已提交
59
current working directory is used. With \fB\-p\fR, use private remote
C
Chris Wanstrath 已提交
60 61
"git@github.com:\fIUSER\fR/\fIREPOSITORY\fR.git". If \fIUSER\fR is "origin"
then uses your GitHub login.
R
Ryan Tomayko 已提交
62 63
.
.TP
C
Chris Wanstrath 已提交
64
\fBgit push\fR \fIREMOTE\-1\fR,\fIREMOTE\-2\fR,...,\fIREMOTE\-N\fR \fIREF\fR
65 66 67 68
Push \fIREF\fR to each of \fIREMOTE\-1\fR through \fIREMOTE\-N\fR by executing
multiple \fBgit push\fR commands.
.
.TP
C
Chris Wanstrath 已提交
69
\fBgit browse\fR [\fB\-p\fR] [[\fIUSER\fR\fB/\fR]\fIREPOSITORY\fR]
C
Chris Wanstrath 已提交
70
Open repository's GitHub page in the system's default web browser
C
Chris Wanstrath 已提交
71
using \fBopen(1)\fR or the \fBBROWSER\fR env variable. Use \fB\-p\fR to open a
72 73
page with https. If the repository isn't specified, \fBbrowse\fR opens
the page of the repository found in the current directory.
C
Chris Wanstrath 已提交
74 75
.
.TP
C
Chris Wanstrath 已提交
76
\fBgit submodule add\fR [\fB\-p\fR] \fIOPTIONS\fR [\fIUSER\fR/]\fIREPOSITORY\fR \fIDIRECTORY\fR
S
Stephen Celis 已提交
77
Submodule repository "git://github.com/\fIUSER\fR/\fIREPOSITORY\fR.git" into \fIDIRECTORY\fR as with git\-submodule(1). When \fIUSER\fR/ is omitted, assumes
C
Chris Wanstrath 已提交
78
your GitHub login. With \fB\-p\fR, use private remote
S
Stephen Celis 已提交
79 80 81
"git@github.com:\fIUSER\fR/\fIREPOSITORY\fR.git".
.
.TP
82 83 84 85 86 87
\fBgit fork\fR [\fB\-\-no\-remote\fR]
Forks the original project (as specified in "origin" remote) on GitHub
and adds a new remote named \fIUSER\fR referencing the newly created repo.
Requires \fBgithub.token\fR to be set (see CONFIGURATION).
.
.TP
R
Ryan Tomayko 已提交
88 89 90 91 92 93
\fBgit help\fR
Display enhanced git\-help(1).
.
.SH "CONFIGURATION"
Use git\-config(1) to display the currently configured GitHub username:
.
94 95
.IP "" 4
.
R
Ryan Tomayko 已提交
96
.nf
C
Chris Wanstrath 已提交
97
$ git config \-\-global github.user
R
Ryan Tomayko 已提交
98 99 100
.
.fi
.
101 102
.IP "" 0
.
R
Ryan Tomayko 已提交
103
.P
104
Or, set the GitHub username and token with:
R
Ryan Tomayko 已提交
105
.
106 107
.IP "" 4
.
R
Ryan Tomayko 已提交
108
.nf
C
Chris Wanstrath 已提交
109
$ git config \-\-global github.user <username>
110
$ git config \-\-global github.token <token>
R
Ryan Tomayko 已提交
111 112 113
.
.fi
.
114 115
.IP "" 0
.
R
Ryan Tomayko 已提交
116
.P
C
Chris Wanstrath 已提交
117 118 119 120 121 122 123 124 125 126
See \fIhttp://github.com/guides/local\-github\-config\fR for more
information.
.
.P
You can also tell \fBhub\fR to use \fBhttp://\fR rather than \fBgit://\fR when
cloning:
.
.IP "" 4
.
.nf
C
Chris Wanstrath 已提交
127
$ git config \-\-global \-\-add hub.http\-clone yes
C
Chris Wanstrath 已提交
128 129 130 131
.
.fi
.
.IP "" 0
R
Ryan Tomayko 已提交
132
.
C
Chris Wanstrath 已提交
133 134 135 136 137
.SH "EXAMPLES"
.
.SS "git clone"
.
.nf
C
Chris Wanstrath 已提交
138 139 140
$ git clone schacon/ticgit
> git clone git://github.com/schacon/ticgit.git
$ git clone \-p schacon/ticgit
C
Chris Wanstrath 已提交
141 142 143
> git clone git@github.com:schacon/ticgit.git
$ git clone resque
> git clone git://github.com/YOUR_USER/resque.git
C
Chris Wanstrath 已提交
144
$ git clone \-p resque
C
Chris Wanstrath 已提交
145 146 147 148 149 150 151
> git clone git@github.com:YOUR_USER/resque.git
.
.fi
.
.SS "git remote add"
.
.nf
C
Chris Wanstrath 已提交
152 153 154
$ git remote add rtomayko
> git remote add rtomayko git://github.com/rtomayko/CURRENT_REPO.git
$ git remote add \-p rtomayko
C
Chris Wanstrath 已提交
155
> git remote add rtomayko git@github.com:rtomayko/CURRENT_REPO.git
C
Chris Wanstrath 已提交
156
$ git remote add origin
C
Chris Wanstrath 已提交
157
> git remote add origin git://github.com/YOUR_USER/CURRENT_REPO.git
C
Chris Wanstrath 已提交
158 159 160
.
.fi
.
161 162 163 164 165 166 167 168 169
.SS "git fork"
.
.nf
$ git fork
... hardcore forking action ...
> git remote add YOUR_USER git@github.com:YOUR_USER/CURRENT_REPO.git
.
.fi
.
C
Chris Wanstrath 已提交
170 171 172
.SS "git init"
.
.nf
C
Chris Wanstrath 已提交
173
$ git init \-g
C
Chris Wanstrath 已提交
174
> git init
C
Chris Wanstrath 已提交
175
> git remote add origin git@github.com:YOUR_USER/REPO.git
C
Chris Wanstrath 已提交
176 177 178 179 180 181
.
.fi
.
.SS "git push"
.
.nf
C
Chris Wanstrath 已提交
182
$ git push origin,staging,qa bert_timeout
C
Chris Wanstrath 已提交
183 184
> git push origin bert_timeout
> git push staging bert_timeout
C
Chris Wanstrath 已提交
185
> git push qa bert_timeout
C
Chris Wanstrath 已提交
186 187 188
.
.fi
.
C
Chris Wanstrath 已提交
189 190 191
.SS "git browse"
.
.nf
C
Chris Wanstrath 已提交
192 193 194
$ git browse schacon/ticgit
> open http://github.com/schacon/ticgit
$ git browse \-p schacon/ticgit
C
Chris Wanstrath 已提交
195 196 197
> open http://github.com/schacon/ticgit
$ git browse resque
> open http://github.com/YOUR_USER/resque
C
Chris Wanstrath 已提交
198
$ git browse \-p resque
C
Chris Wanstrath 已提交
199 200 201 202
> open https://github.com:YOUR_USER/resque
.
.fi
.
C
Chris Wanstrath 已提交
203 204 205
.SS "git help"
.
.nf
C
Chris Wanstrath 已提交
206
$ git help
C
Chris Wanstrath 已提交
207 208
> (improved git help)
$ git help hub
C
Chris Wanstrath 已提交
209
> (hub man page)
C
Chris Wanstrath 已提交
210 211 212
.
.fi
.
R
Ryan Tomayko 已提交
213 214 215 216 217 218 219
.SH "BUGS"
\fIhttp://github.com/defunkt/hub/issues\fR
.
.SH "AUTHOR"
Chris Wanstrath :: chris@ozmm.org :: @defunkt
.
.SH "SEE ALSO"
220
git(1), git\-clone(1), git\-remote(1), git\-init(1),\fIhttp://github.com\fR, \fIhttp://github.com/defunkt/hub\fR