hub.1 5.2 KB
Newer Older
1
.\" generated with Ron/v0.3
R
Ryan Tomayko 已提交
2 3
.\" http://github.com/rtomayko/ron/
.
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
0.3.1  
Chris Wanstrath 已提交
10 11 12
\fBhub\fR \fICOMMAND\fR \fIOPTIONS\fR 
.
.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
64 65 66 67 68
\fBgit push\fR \fIREMOTE\-1\fR,\fIREMOTE\-2\fR,...,\fIREMOTE\-N\fR \fIREF\fR 
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
R
Ryan Tomayko 已提交
82 83 84 85 86 87
\fBgit help\fR
Display enhanced git\-help(1).
.
.SH "CONFIGURATION"
Use git\-config(1) to display the currently configured GitHub username:
.
88 89
.IP "" 4
.
R
Ryan Tomayko 已提交
90
.nf
91

C
Chris Wanstrath 已提交
92
\fB$ git config --global github.user \fR
R
Ryan Tomayko 已提交
93 94 95
.
.fi
.
96 97
.IP "" 0
.
R
Ryan Tomayko 已提交
98 99 100
.P
Or, set the GitHub username with:
.
101 102
.IP "" 4
.
R
Ryan Tomayko 已提交
103
.nf
104

C
Chris Wanstrath 已提交
105
\fB$ git config --global github.user <username> \fR
R
Ryan Tomayko 已提交
106 107 108
.
.fi
.
109 110
.IP "" 0
.
R
Ryan Tomayko 已提交
111
.P
C
Chris Wanstrath 已提交
112 113 114 115 116 117 118 119 120 121 122
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 已提交
123
\fB$ git config --global --add hub.http-clone yes \fR
C
Chris Wanstrath 已提交
124 125 126 127
.
.fi
.
.IP "" 0
R
Ryan Tomayko 已提交
128
.
C
Chris Wanstrath 已提交
129 130 131 132 133 134
.SH "EXAMPLES"
.
.SS "git clone"
.
.nf

C
Chris Wanstrath 已提交
135
\fB$ git clone schacon/ticgit
C
Chris Wanstrath 已提交
136
> git clone git://github.com/schacon/ticgit.git 
C
Chris Wanstrath 已提交
137
$ git clone -p schacon/ticgit
C
Chris Wanstrath 已提交
138 139 140 141 142
> git clone git@github.com:schacon/ticgit.git

$ git clone resque
> git clone git://github.com/YOUR_USER/resque.git

C
Chris Wanstrath 已提交
143
$ git clone -p resque
C
Chris Wanstrath 已提交
144
> git clone git@github.com:YOUR_USER/resque.git
C
Chris Wanstrath 已提交
145
\fR
C
Chris Wanstrath 已提交
146 147 148 149 150 151 152
.
.fi
.
.SS "git remote add"
.
.nf

C
Chris Wanstrath 已提交
153
\fB$ git remote add rtomayko
C
Chris Wanstrath 已提交
154
> git remote add rtomayko git://github.com/rtomayko/CURRENT_REPO.git 
C
Chris Wanstrath 已提交
155
$ git remote add -p rtomayko
C
Chris Wanstrath 已提交
156
> git remote add rtomayko git@github.com:rtomayko/CURRENT_REPO.git
C
Chris Wanstrath 已提交
157 158

$ git remote add origin
C
Chris Wanstrath 已提交
159
> git remote add origin git://github.com/YOUR_USER/CURRENT_REPO.git
C
Chris Wanstrath 已提交
160
\fR
C
Chris Wanstrath 已提交
161 162 163 164 165 166 167
.
.fi
.
.SS "git init"
.
.nf

C
Chris Wanstrath 已提交
168
\fB$ git init -g
C
Chris Wanstrath 已提交
169
> git init
C
Chris Wanstrath 已提交
170
> git remote add origin git@github.com:YOUR_USER/REPO.git \fR
C
Chris Wanstrath 已提交
171 172 173 174 175 176 177
.
.fi
.
.SS "git push"
.
.nf

C
Chris Wanstrath 已提交
178
\fB$ git push origin,staging,qa bert_timeout
C
Chris Wanstrath 已提交
179 180
> git push origin bert_timeout
> git push staging bert_timeout
C
Chris Wanstrath 已提交
181
> git push qa bert_timeout \fR
C
Chris Wanstrath 已提交
182 183 184
.
.fi
.
C
Chris Wanstrath 已提交
185 186 187 188
.SS "git browse"
.
.nf

C
Chris Wanstrath 已提交
189
\fB$ git browse schacon/ticgit
C
Chris Wanstrath 已提交
190
> open http://github.com/schacon/ticgit 
C
Chris Wanstrath 已提交
191
$ git browse -p schacon/ticgit
C
Chris Wanstrath 已提交
192 193 194 195 196
> open http://github.com/schacon/ticgit

$ git browse resque
> open http://github.com/YOUR_USER/resque

C
Chris Wanstrath 已提交
197
$ git browse -p resque
C
Chris Wanstrath 已提交
198
> open https://github.com:YOUR_USER/resque
C
Chris Wanstrath 已提交
199
\fR
C
Chris Wanstrath 已提交
200 201 202
.
.fi
.
C
Chris Wanstrath 已提交
203 204 205 206
.SS "git help"
.
.nf

C
Chris Wanstrath 已提交
207
\fB$ git help
C
Chris Wanstrath 已提交
208 209
> (improved git help)
$ git help hub
C
Chris Wanstrath 已提交
210
> (hub man page) \fR
C
Chris Wanstrath 已提交
211 212 213
.
.fi
.
R
Ryan Tomayko 已提交
214 215 216 217 218 219 220
.SH "BUGS"
\fIhttp://github.com/defunkt/hub/issues\fR
.
.SH "AUTHOR"
Chris Wanstrath :: chris@ozmm.org :: @defunkt
.
.SH "SEE ALSO"
221
git(1), git\-clone(1), git\-remote(1), git\-init(1),\fIhttp://github.com\fR, \fIhttp://github.com/defunkt/hub\fR