hub.1 4.6 KB
Newer Older
1
.\" generated with Ron/v0.3
R
Ryan Tomayko 已提交
2 3
.\" http://github.com/rtomayko/ron/
.
C
Chris Wanstrath 已提交
4
.TH "HUB" "1" "February 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 13 14 15
\fBhub\fR \fICOMMAND\fR \fIOPTIONS\fR 
.
.br
\fBhub alias\fR [\fB\-s\fR] \fISHELL\fR 
.
.br
R
Ryan Tomayko 已提交
16 17
.
.P
C
0.3.1  
Chris Wanstrath 已提交
18 19 20 21 22 23 24 25 26 27 28 29
\fBgit init \-g\fR \fIOPTIONS\fR 
.
.br
\fBgit clone\fR [\fB\-p\fR] \fIOPTIONS\fR [\fIUSER\fR/]\fIREPOSITORY\fR \fIDIRECTORY\fR 
.
.br
\fBgit remote add\fR [\fB\-p\fR] \fIOPTIONS\fR \fIUSER\fR[/\fIREPOSITORY\fR] 
.
.br
\fBgit browse\fR [\fB\-p\fR] [\fIUSER\fR/]\fIREPOSITORY\fR 
.
.br
R
Ryan Tomayko 已提交
30 31 32 33 34 35
.
.SH "DESCRIPTION"
\fBhub\fR enhances various \fBgit\fR commands with GitHub remote expansion. The
alias command displays information on configuring your environment:
.
.TP
36
\fBhub alias\fR [\fB\-s\fR] \fISHELL\fR 
C
Chris Wanstrath 已提交
37 38
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 已提交
39 40 41 42 43
.
.P
After configuring the alias, the following commands have superpowers:
.
.TP
44
\fBgit init\fR \fB\-g\fR \fIOPTIONS\fR 
R
Ryan Tomayko 已提交
45
Create a git repository as with git\-init(1) and add remote \fBorigin\fR at
46
"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 已提交
47 48
.
.TP
C
Chris Wanstrath 已提交
49 50 51 52
\fBgit clone\fR [\fB\-p\fR] \fIOPTIONS\fR [\fIUSER\fR\fB/\fR]\fIREPOSITORY\fR \fIDIRECTORY\fR 
Clone repository "git://github.com/\fIUSER\fR/\fIREPOSITORY\fR.git" into \fIDIRECTORY\fR as with git\-clone(1). When \fIUSER\fR/ is omitted, assumes
your GitHub login. With \fB\-p\fR, use private remote
"git@github.com:\fIUSER\fR/\fIREPOSITORY\fR.git".
R
Ryan Tomayko 已提交
53 54
.
.TP
C
Chris Wanstrath 已提交
55
\fBgit remote add\fR [\fB\-p\fR] \fIOPTIONS\fR \fIUSER\fR[\fB/\fR\fIREPOSITORY\fR]
56 57
Add remote "git://github.com/\fIUSER\fR/\fIREPOSITORY\fR.git" as with
git\-remote(1). When /\fIREPOSITORY\fR is omitted, the basename of the
R
Ryan Tomayko 已提交
58
current working directory is used. With \fB\-p\fR, use private remote
C
Chris Wanstrath 已提交
59 60
"git@github.com:\fIUSER\fR/\fIREPOSITORY\fR.git". If \fIUSER\fR is "origin"
then uses your GitHub login.
R
Ryan Tomayko 已提交
61 62
.
.TP
63 64 65 66 67
\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 已提交
68 69 70 71 72 73
\fBgit browse\fR [\fB\-p\fR] [\fIUSER\fR\fB/\fR]\fIREPOSITORY\fR 
Open repository's GitHub page in the system's default web browser
using \fBopen(1)\fR or the \fBBROWSER\fR env variable. Use \fB\-p\fR to open a
page with https.
.
.TP
R
Ryan Tomayko 已提交
74 75 76 77 78 79
\fBgit help\fR
Display enhanced git\-help(1).
.
.SH "CONFIGURATION"
Use git\-config(1) to display the currently configured GitHub username:
.
80 81
.IP "" 4
.
R
Ryan Tomayko 已提交
82
.nf
83

R
Ryan Tomayko 已提交
84 85 86 87
$ git config \-\-global github.user 
.
.fi
.
88 89
.IP "" 0
.
R
Ryan Tomayko 已提交
90 91 92
.P
Or, set the GitHub username with:
.
93 94
.IP "" 4
.
R
Ryan Tomayko 已提交
95
.nf
96

R
Ryan Tomayko 已提交
97 98 99 100
$ git config \-\-global github.user <username> 
.
.fi
.
101 102
.IP "" 0
.
R
Ryan Tomayko 已提交
103
.P
C
Chris Wanstrath 已提交
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
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

$ git config \-\-global \-\-add hub.http\-clone yes 
.
.fi
.
.IP "" 0
R
Ryan Tomayko 已提交
120
.
C
Chris Wanstrath 已提交
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
.SH "EXAMPLES"
.
.SS "git clone"
.
.nf

$ git clone schacon/ticgit
> git clone git://github.com/schacon/ticgit.git 
$ git clone \-p schacon/ticgit
> git clone git@github.com:schacon/ticgit.git

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

$ git clone \-p resque
> git clone git@github.com:YOUR_USER/resque.git
.
.fi
.
.SS "git remote add"
.
.nf

$ git remote add rtomayko
> git remote add rtomayko git://github.com/rtomayko/CURRENT_REPO.git 
$ git remote add \-p rtomayko
> git remote add rtomayko git@github.com:rtomayko/CURRENT_REPO.git
C
Chris Wanstrath 已提交
148 149

$ git remote add origin
C
Chris Wanstrath 已提交
150
> git remote add origin git://github.com/YOUR_USER/CURRENT_REPO.git
C
Chris Wanstrath 已提交
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
.
.fi
.
.SS "git init"
.
.nf

$ git init \-g
> git init
> git remote add origin git@github.com:YOUR_USER/REPO.git 
.
.fi
.
.SS "git push"
.
.nf

$ git push origin,staging,qa bert_timeout
> git push origin bert_timeout
> git push staging bert_timeout
> git push qa bert_timeout 
.
.fi
.
C
Chris Wanstrath 已提交
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
.SS "git browse"
.
.nf

$ git browse schacon/ticgit
> open http://github.com/schacon/ticgit 
$ git browse \-p schacon/ticgit
> open http://github.com/schacon/ticgit

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

$ git browse \-p resque
> open https://github.com:YOUR_USER/resque
.
.fi
.
C
Chris Wanstrath 已提交
192 193 194 195 196 197 198 199 200 201 202
.SS "git help"
.
.nf

$ git help
> (improved git help)
$ git help hub
> (hub man page) 
.
.fi
.
R
Ryan Tomayko 已提交
203 204 205 206 207 208 209
.SH "BUGS"
\fIhttp://github.com/defunkt/hub/issues\fR
.
.SH "AUTHOR"
Chris Wanstrath :: chris@ozmm.org :: @defunkt
.
.SH "SEE ALSO"
210
git(1), git\-clone(1), git\-remote(1), git\-init(1),\fIhttp://github.com\fR, \fIhttp://github.com/defunkt/hub\fR