Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 258 lines (184 sloc) 8.388 kb
3d4787e @rtomayko hub(1) manual page
rtomayko authored
1 hub(1) -- git + hub = github
2 ============================
3
4 ## SYNOPSIS
5
231366d @mislav tracking branches awarness; `git browse` subpages (e.g. `git browse r…
mislav authored
6 `hub` <COMMAND> <OPTIONS>
75d0013 @defunkt update man with hub-fork
defunkt authored
7 `hub alias` [`-s`] <SHELL>
3d4787e @rtomayko hub(1) manual page
rtomayko authored
8
75d0013 @defunkt update man with hub-fork
defunkt authored
9 `git init -g` <OPTIONS>
c149156 @justinweiss somehow forgot a dash in the manpage
justinweiss authored
10 `git create` [`-p`] [`-d <DESCRIPTION>`] [`-h <HOMEPAGE>`]:
75d0013 @defunkt update man with hub-fork
defunkt authored
11 `git clone` [`-p`] <OPTIONS> [<USER>/]<REPOSITORY> <DIRECTORY>
12 `git remote add` [`-p`] <OPTIONS> <USER>[/<REPOSITORY>]
9d23c99 @defunkt Docs: Mention `git remote set-url` support
defunkt authored
13 `git remote set-url` [`-p`] <OPTIONS> <REMOTE-NAME> <USER>[/<REPOSITORY>]
7ac3b02 @mislav enhanced `git fetch <fork>` to add new remotes if missing
mislav authored
14 `git fetch` <USER-1>,[<USER-2>,...]
3c6af16 @mislav magic `cherry-pick` supports GitHub commit URLs and "user@sha" notation
mislav authored
15 `git cherry-pick` <GITHUB-REF>
75d0013 @defunkt update man with hub-fork
defunkt authored
16 `git push` <REMOTE-1>,<REMOTE-2>,...,<REMOTE-N> <REF>
21225f8 @mislav update manpage & readme tweaks. don't suggest to uninstall the "git-h…
mislav authored
17 `git browse` [`-p`] [`-u`] [[<USER>`/`]<REPOSITORY>] [SUBPAGE]
18 `git compare` [`-p`] [`-u`] [<USER>] [<START>...]<END>
75d0013 @defunkt update man with hub-fork
defunkt authored
19 `git submodule add` [`-p`] <OPTIONS> [<USER>/]<REPOSITORY> <DIRECTORY>
21225f8 @mislav update manpage & readme tweaks. don't suggest to uninstall the "git-h…
mislav authored
20 `git fork` [`--no-remote`]
3d4787e @rtomayko hub(1) manual page
rtomayko authored
21
22 ## DESCRIPTION
23
24 `hub` enhances various `git` commands with GitHub remote expansion. The
25 alias command displays information on configuring your environment:
26
282e905 Updated to use the newer ronn instead of ron.
Chris Brown authored
27 * `hub alias` [`-s`] <SHELL>:
c13a467 @rtomayko Use uppercase for variables in manpage
rtomayko authored
28 Writes shell aliasing code for <SHELL> (`bash`, `sh`, `zsh`,
29 `csh`) to standard output. With the `-s` option, the output of
231366d @mislav tracking branches awarness; `git browse` subpages (e.g. `git browse r…
mislav authored
30 this command can be evaluated directly within the shell:
3d4787e @rtomayko hub(1) manual page
rtomayko authored
31 `eval $(hub alias -s bash)`
32
282e905 Updated to use the newer ronn instead of ron.
Chris Brown authored
33 * `git init` `-g` <OPTIONS>:
3d4787e @rtomayko hub(1) manual page
rtomayko authored
34 Create a git repository as with git-init(1) and add remote `origin` at
c13a467 @rtomayko Use uppercase for variables in manpage
rtomayko authored
35 "git@github.com:<USER>/<REPOSITORY>.git"; <USER> is your GitHub username and
36 <REPOSITORY> is the current working directory's basename.
3d4787e @rtomayko hub(1) manual page
rtomayko authored
37
c149156 @justinweiss somehow forgot a dash in the manpage
justinweiss authored
38 * `git create` [`-p`] [`-d <DESCRIPTION>`] [`-h <HOMEPAGE>`]:
d098694 @justinweiss Added documentation on `hub create`
justinweiss authored
39 Create a new public github repository from the current git
40 repository and add remote `origin` at
41 "git@github.com:<USER>/<REPOSITORY>.git"; <USER> is your GitHub
42 username and <REPOSITORY> is the current working directory's
43 basename. With `-p`, create a private repository. `-d` and `-h`
44 set the repository's description and homepage, respectively.
45
282e905 Updated to use the newer ronn instead of ron.
Chris Brown authored
46 * `git clone` [`-p`] <OPTIONS> [<USER>`/`]<REPOSITORY> <DIRECTORY>:
c13a467 @rtomayko Use uppercase for variables in manpage
rtomayko authored
47 Clone repository "git://github.com/<USER>/<REPOSITORY>.git" into
91e9747 @defunkt correct man page
defunkt authored
48 <DIRECTORY> as with git-clone(1). When <USER>/ is omitted, assumes
49 your GitHub login. With `-p`, use private remote
50 "git@github.com:<USER>/<REPOSITORY>.git".
3d4787e @rtomayko hub(1) manual page
rtomayko authored
51
282e905 Updated to use the newer ronn instead of ron.
Chris Brown authored
52 * `git remote add` [`-p`] <OPTIONS> <USER>[`/`<REPOSITORY>]:
c13a467 @rtomayko Use uppercase for variables in manpage
rtomayko authored
53 Add remote "git://github.com/<USER>/<REPOSITORY>.git" as with
54 git-remote(1). When /<REPOSITORY> is omitted, the basename of the
3d4787e @rtomayko hub(1) manual page
rtomayko authored
55 current working directory is used. With `-p`, use private remote
6f08436 @defunkt Add `hub remote origin` shortcut. Assumes your GitHub login.
defunkt authored
56 "git@github.com:<USER>/<REPOSITORY>.git". If <USER> is "origin"
57 then uses your GitHub login.
3d4787e @rtomayko hub(1) manual page
rtomayko authored
58
9d23c99 @defunkt Docs: Mention `git remote set-url` support
defunkt authored
59 * `git remote set-url` [`-p`] <OPTIONS> <REMOTE-NAME> <USER>[/<REPOSITORY>]
60 Sets the url of remote <REMOTE-NAME> using the same rules as
61 `git remote add`.
62
7ac3b02 @mislav enhanced `git fetch <fork>` to add new remotes if missing
mislav authored
63 * `git fetch` <USER-1>,[<USER-2>,...]:
64 Adds missing remote(s) with `git remote add` prior to fetching. New
65 remotes are only added if they correspond to valid forks on GitHub.
66
3c6af16 @mislav magic `cherry-pick` supports GitHub commit URLs and "user@sha" notation
mislav authored
67 * `git cherry-pick` <GITHUB-REF>:
68 Cherry-pick a commit from a fork using either full URL to the commit
69 or GitHub-flavored Markdown notation, which is `user@sha`. If the remote
70 doesn't yet exist, it will be added. A `git fetch <user>` is issued
71 prior to the cherry-pick attempt.
72
282e905 Updated to use the newer ronn instead of ron.
Chris Brown authored
73 * `git push` <REMOTE-1>,<REMOTE-2>,...,<REMOTE-N> <REF>:
624662f @defunkt update docs with new git-push info
defunkt authored
74 Push <REF> to each of <REMOTE-1> through <REMOTE-N> by executing
75 multiple `git push` commands.
76
231366d @mislav tracking branches awarness; `git browse` subpages (e.g. `git browse r…
mislav authored
77 * `git browse` [`-p`] [`-u`] [[<USER>`/`]<REPOSITORY>] [SUBPAGE]:
11d96c3 @defunkt Add `hub browse` command for opening a repo in a browser.
defunkt authored
78 Open repository's GitHub page in the system's default web browser
79 using `open(1)` or the `BROWSER` env variable. Use `-p` to open a
ef3271a @mislav `hub browse` with no repository specified defaults to current repo
mislav authored
80 page with https. If the repository isn't specified, `browse` opens
231366d @mislav tracking branches awarness; `git browse` subpages (e.g. `git browse r…
mislav authored
81 the page of the repository found in the current directory. If SUBPAGE
82 is specified, the browser will open on the specified subpage: one of
83 "wiki", "commits", "issues" or other (the default is "tree").
11d96c3 @defunkt Add `hub browse` command for opening a repo in a browser.
defunkt authored
84
231366d @mislav tracking branches awarness; `git browse` subpages (e.g. `git browse r…
mislav authored
85 * `git compare` [`-p`] [`-u`] [<USER>] [<START>...]<END>:
cede3b9 @defunkt Add tests for `hub compare`
defunkt authored
86 Open a GitHub compare view page in the system's default web browser.
2155deb @joshthecoder Add "compare" command.
joshthecoder authored
87 <START> to <END> are branch names, tag names, or commit SHA1s specifying
231366d @mislav tracking branches awarness; `git browse` subpages (e.g. `git browse r…
mislav authored
88 the range of history to compare. If <START> is omitted, GitHub will
89 compare against the base branch (the default is "master").
2155deb @joshthecoder Add "compare" command.
joshthecoder authored
90
282e905 Updated to use the newer ronn instead of ron.
Chris Brown authored
91 * `git submodule add` [`-p`] <OPTIONS> [<USER>/]<REPOSITORY> <DIRECTORY>:
a86a16b @stephencelis Add submodule to manpages.
stephencelis authored
92 Submodule repository "git://github.com/<USER>/<REPOSITORY>.git" into
93 <DIRECTORY> as with git-submodule(1). When <USER>/ is omitted, assumes
94 your GitHub login. With `-p`, use private remote
95 "git@github.com:<USER>/<REPOSITORY>.git".
96
282e905 Updated to use the newer ronn instead of ron.
Chris Brown authored
97 * `git fork` [`--no-remote`]:
21225f8 @mislav update manpage & readme tweaks. don't suggest to uninstall the "git-h…
mislav authored
98 Forks the original project (referenced by "origin" remote) on GitHub and
99 adds a new remote for it under your username. Requires `github.token` to
100 be set (see CONFIGURATION).
6e444c7 @mislav `hub fork` forks a project on GitHub and adds the new remote
mislav authored
101
282e905 Updated to use the newer ronn instead of ron.
Chris Brown authored
102 * `git help`:
3d4787e @rtomayko hub(1) manual page
rtomayko authored
103 Display enhanced git-help(1).
104
105 ## CONFIGURATION
106
107 Use git-config(1) to display the currently configured GitHub username:
108
109 $ git config --global github.user
110
6e444c7 @mislav `hub fork` forks a project on GitHub and adds the new remote
mislav authored
111 Or, set the GitHub username and token with:
3d4787e @rtomayko hub(1) manual page
rtomayko authored
112
113 $ git config --global github.user <username>
6e444c7 @mislav `hub fork` forks a project on GitHub and adds the new remote
mislav authored
114 $ git config --global github.token <token>
3d4787e @rtomayko hub(1) manual page
rtomayko authored
115
cff1869 @defunkt hub.http-clone config setting
defunkt authored
116 See <http://github.com/guides/local-github-config> for more
117 information.
118
119 You can also tell `hub` to use `http://` rather than `git://` when
120 cloning:
121
743649e @mislav create Hub::Context and refactor how hub interacts with git
mislav authored
122 $ git config --global --bool hub.http-clone true
3d4787e @rtomayko hub(1) manual page
rtomayko authored
123
a36bd94 @defunkt add EXAMPLES to man page
defunkt authored
124 ## EXAMPLES
125
126 ### git clone
127
128 $ git clone schacon/ticgit
129 > git clone git://github.com/schacon/ticgit.git
130
131 $ git clone -p schacon/ticgit
132 > git clone git@github.com:schacon/ticgit.git
133
134 $ git clone resque
135 > git clone git://github.com/YOUR_USER/resque.git
136
137 $ git clone -p resque
138 > git clone git@github.com:YOUR_USER/resque.git
139
140 ### git remote add
141
142 $ git remote add rtomayko
143 > git remote add rtomayko git://github.com/rtomayko/CURRENT_REPO.git
144
145 $ git remote add -p rtomayko
146 > git remote add rtomayko git@github.com:rtomayko/CURRENT_REPO.git
147
6f08436 @defunkt Add `hub remote origin` shortcut. Assumes your GitHub login.
defunkt authored
148 $ git remote add origin
04547d9 @defunkt fix typo
defunkt authored
149 > git remote add origin git://github.com/YOUR_USER/CURRENT_REPO.git
6f08436 @defunkt Add `hub remote origin` shortcut. Assumes your GitHub login.
defunkt authored
150
7ac3b02 @mislav enhanced `git fetch <fork>` to add new remotes if missing
mislav authored
151 ### git fetch
152
153 $ git fetch mislav
154 > git remote add mislav git://github.com/mislav/REPO.git
155 > git fetch mislav
156
157 $ git fetch mislav,xoebus
158 > git remote add mislav ...
159 > git remote add xoebus ...
160 > git fetch --multiple mislav xoebus
161
3c6af16 @mislav magic `cherry-pick` supports GitHub commit URLs and "user@sha" notation
mislav authored
162 ### git cherry-pick
163
164 $ git cherry-pick http://github.com/mislav/REPO/commit/SHA
165 > git remote add -f mislav git://github.com/mislav/REPO.git
166 > git cherry-pick SHA
167
168 $ git cherry-pick mislav@SHA
169 > git remote add -f mislav git://github.com/mislav/CURRENT_REPO.git
170 > git cherry-pick SHA
171
172 $ git cherry-pick mislav@SHA
173 > git fetch mislav
174 > git cherry-pick SHA
175
6e444c7 @mislav `hub fork` forks a project on GitHub and adds the new remote
mislav authored
176 ### git fork
177
178 $ git fork
179 ... hardcore forking action ...
180 > git remote add YOUR_USER git@github.com:YOUR_USER/CURRENT_REPO.git
181
a36bd94 @defunkt add EXAMPLES to man page
defunkt authored
182 ### git init
183
184 $ git init -g
185 > git init
186 > git remote add origin git@github.com:YOUR_USER/REPO.git
187
d098694 @justinweiss Added documentation on `hub create`
justinweiss authored
188 ### git create
189
190 $ git create
191 ... hardcore creating action ...
192 > git remote add origin git@github.com:YOUR_USER/CURRENT_REPO.git
193
a36bd94 @defunkt add EXAMPLES to man page
defunkt authored
194 ### git push
195
196 $ git push origin,staging,qa bert_timeout
197 > git push origin bert_timeout
198 > git push staging bert_timeout
199 > git push qa bert_timeout
200
fd63f9b @defunkt add `git browse` examples to the man page
defunkt authored
201 ### git browse
202
231366d @mislav tracking branches awarness; `git browse` subpages (e.g. `git browse r…
mislav authored
203 $ git browse
204 > open http://github.com/CURRENT_REPO
205
206 $ git browse -- issues
207 > open http://github.com/CURRENT_REPO/issues
208
fd63f9b @defunkt add `git browse` examples to the man page
defunkt authored
209 $ git browse schacon/ticgit
210 > open http://github.com/schacon/ticgit
211
212 $ git browse -p schacon/ticgit
853f40f Some small fixes and additions to help and documentation.
Chris Brown authored
213 > open https://github.com/schacon/ticgit
fd63f9b @defunkt add `git browse` examples to the man page
defunkt authored
214
215 $ git browse resque
216 > open http://github.com/YOUR_USER/resque
217
231366d @mislav tracking branches awarness; `git browse` subpages (e.g. `git browse r…
mislav authored
218 $ git browse resque network
219 > open http://github.com/YOUR_USER/resque/network
220
fd63f9b @defunkt add `git browse` examples to the man page
defunkt authored
221 $ git browse -p resque
231366d @mislav tracking branches awarness; `git browse` subpages (e.g. `git browse r…
mislav authored
222 > open https://github.com/YOUR_USER/resque
fd63f9b @defunkt add `git browse` examples to the man page
defunkt authored
223
2155deb @joshthecoder Add "compare" command.
joshthecoder authored
224 ### git compare
225
226 $ git compare refactor
227 > open http://github.com/CURRENT_REPO/compare/refactor
228
229 $ git compare 1.0...1.1
230 > open http://github.com/CURRENT_REPO/compare/1.0...1.1
231
232 $ git compare -u fix
233 > (http://github.com/CURRENT_REPO/compare/fix)
234
853f40f Some small fixes and additions to help and documentation.
Chris Brown authored
235 $ git compare other-user patch
236 > open http://github.com/other-user/REPO/compare/patch
2155deb @joshthecoder Add "compare" command.
joshthecoder authored
237
a36bd94 @defunkt add EXAMPLES to man page
defunkt authored
238 ### git help
239
240 $ git help
241 > (improved git help)
242 $ git help hub
243 > (hub man page)
244
3d4787e @rtomayko hub(1) manual page
rtomayko authored
245 ## BUGS
246
247 <http://github.com/defunkt/hub/issues>
248
249 ## AUTHOR
250
251 Chris Wanstrath :: chris@ozmm.org :: @defunkt
252
253 ## SEE ALSO
254
255 git(1), git-clone(1), git-remote(1), git-init(1),
256 <http://github.com>,
257 <http://github.com/defunkt/hub>
Something went wrong with that request. Please try again.