Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 197 lines (149 sloc) 8.408 kb
3d4787e @rtomayko hub(1) manual page
rtomayko authored
1 hub(1) -- git + hub = github
2 ============================
3
4 ## SYNOPSIS
5
be476ba @mislav introduce `hub --noop` to output which commands would be run
mislav authored
6 `hub` [`--noop`] <COMMAND> <OPTIONS>
a0f5504 @mislav better, smarter `hub alias` command
mislav authored
7 `hub alias` [`-s`] [<SHELL>]
3d4787e @rtomayko hub(1) manual page
rtomayko authored
8
691650a @mislav update man page to separate custom hub commands from git
mislav authored
9 ### Expanded git commands:
10
75d0013 @defunkt update man with hub-fork
defunkt authored
11 `git init -g` <OPTIONS>
12 `git clone` [`-p`] <OPTIONS> [<USER>/]<REPOSITORY> <DIRECTORY>
13 `git remote add` [`-p`] <OPTIONS> <USER>[/<REPOSITORY>]
9d23c99 @defunkt Docs: Mention `git remote set-url` support
defunkt authored
14 `git remote set-url` [`-p`] <OPTIONS> <REMOTE-NAME> <USER>[/<REPOSITORY>]
7ac3b02 @mislav enhanced `git fetch <fork>` to add new remotes if missing
mislav authored
15 `git fetch` <USER-1>,[<USER-2>,...]
d88e9a4 @mislav `hub checkout` can fetch and checkout a pull request
mislav authored
16 `git checkout` <PULLREQ-URL> [<BRANCH>]
4719f39 @mislav simplify and better document `hub merge` command
mislav authored
17 `git merge` <PULLREQ-URL>
3c6af16 @mislav magic `cherry-pick` supports GitHub commit URLs and "user@sha" notation
mislav authored
18 `git cherry-pick` <GITHUB-REF>
005198e @mislav ability to cherry-pick pull requests and commits with `hub am`
mislav authored
19 `git am` <GITHUB-URL>
26963ef @mislav add documentation about `hub apply`
mislav authored
20 `git apply` <GITHUB-URL>
1cdda74 @mislav `git push remote1,remote2` without branch name pushes the current branch
mislav authored
21 `git push` <REMOTE-1>,<REMOTE-2>,...,<REMOTE-N> [<REF>]
691650a @mislav update man page to separate custom hub commands from git
mislav authored
22 `git submodule add` [`-p`] <OPTIONS> [<USER>/]<REPOSITORY> <DIRECTORY>
23
24 ### Custom git commands:
25
26 `git create` [<NAME>] [`-p`] [`-d` <DESCRIPTION>] [`-h` <HOMEPAGE>]
de3ab41 @mislav browse/compare/cherry-pick: compensate for GitHub switch to HTTPS
mislav authored
27 `git browse` [`-u`] [[<USER>`/`]<REPOSITORY>] [SUBPAGE]
28 `git compare` [`-u`] [<USER>] [<START>...]<END>
21225f8 @mislav update manpage & readme tweaks. don't suggest to uninstall the "git-h…
mislav authored
29 `git fork` [`--no-remote`]
a4b7a20 @mislav remove extra colon in man page
mislav authored
30 `git pull-request` [`-f`] [<TITLE>|`-i` <ISSUE>] [`-b` <BASE>] [`-h` <HEAD>]
3d4787e @rtomayko hub(1) manual page
rtomayko authored
31
32 ## DESCRIPTION
33
691650a @mislav update man page to separate custom hub commands from git
mislav authored
34 hub enhances various git commands to ease most common workflows with GitHub.
3d4787e @rtomayko hub(1) manual page
rtomayko authored
35
be476ba @mislav introduce `hub --noop` to output which commands would be run
mislav authored
36 * `hub --noop` <COMMAND>:
37 Shows which command(s) would be run as a result of the current command.
38 Doesn't perform anything.
39
a0f5504 @mislav better, smarter `hub alias` command
mislav authored
40 * `hub alias` [`-s`] [<SHELL>]:
41 Shows shell instructions for wrapping git. If given, <SHELL> specifies the
42 type of shell; otherwise defaults to the value of SHELL environment
43 variable. With `-s`, outputs shell script suitable for `eval`.
3d4787e @rtomayko hub(1) manual page
rtomayko authored
44
282e905 Updated to use the newer ronn instead of ron.
Chris Brown authored
45 * `git init` `-g` <OPTIONS>:
3d4787e @rtomayko hub(1) manual page
rtomayko authored
46 Create a git repository as with git-init(1) and add remote `origin` at
c13a467 @rtomayko Use uppercase for variables in manpage
rtomayko authored
47 "git@github.com:<USER>/<REPOSITORY>.git"; <USER> is your GitHub username and
48 <REPOSITORY> is the current working directory's basename.
3d4787e @rtomayko hub(1) manual page
rtomayko authored
49
691650a @mislav update man page to separate custom hub commands from git
mislav authored
50 * `git clone` [`-p`] <OPTIONS> [<USER>`/`]<REPOSITORY> <DIRECTORY>:
c13a467 @rtomayko Use uppercase for variables in manpage
rtomayko authored
51 Clone repository "git://github.com/<USER>/<REPOSITORY>.git" into
91e9747 @defunkt correct man page
defunkt authored
52 <DIRECTORY> as with git-clone(1). When <USER>/ is omitted, assumes
49ba771 @mislav update documentation about cloning your own repos
mislav authored
53 your GitHub login. With `-p`, clone private repositories over SSH.
54 For repositories under your GitHub login, `-p` is implicit.
3d4787e @rtomayko hub(1) manual page
rtomayko authored
55
691650a @mislav update man page to separate custom hub commands from git
mislav authored
56 * `git remote add` [`-p`] <OPTIONS> <USER>[`/`<REPOSITORY>]:
c13a467 @rtomayko Use uppercase for variables in manpage
rtomayko authored
57 Add remote "git://github.com/<USER>/<REPOSITORY>.git" as with
58 git-remote(1). When /<REPOSITORY> is omitted, the basename of the
3d4787e @rtomayko hub(1) manual page
rtomayko authored
59 current working directory is used. With `-p`, use private remote
6f08436 @defunkt Add `hub remote origin` shortcut. Assumes your GitHub login.
defunkt authored
60 "git@github.com:<USER>/<REPOSITORY>.git". If <USER> is "origin"
61 then uses your GitHub login.
3d4787e @rtomayko hub(1) manual page
rtomayko authored
62
691650a @mislav update man page to separate custom hub commands from git
mislav authored
63 * `git remote set-url` [`-p`] <OPTIONS> <REMOTE-NAME> <USER>[/<REPOSITORY>]:
9d23c99 @defunkt Docs: Mention `git remote set-url` support
defunkt authored
64 Sets the url of remote <REMOTE-NAME> using the same rules as
65 `git remote add`.
66
7ac3b02 @mislav enhanced `git fetch <fork>` to add new remotes if missing
mislav authored
67 * `git fetch` <USER-1>,[<USER-2>,...]:
68 Adds missing remote(s) with `git remote add` prior to fetching. New
69 remotes are only added if they correspond to valid forks on GitHub.
70
d88e9a4 @mislav `hub checkout` can fetch and checkout a pull request
mislav authored
71 * `git checkout` <PULLREQ-URL> [<BRANCH>]:
72 Checks out the head of the pull request as a local branch, to allow for
73 reviewing, rebasing and otherwise cleaning up the commits in the pull
74 request before merging. The name of the local branch can explicitly be
75 set with <BRANCH>.
76
e307ce9 @jfirebaugh Add `hub merge` command
jfirebaugh authored
77 * `git merge` <PULLREQ-URL>:
4719f39 @mislav simplify and better document `hub merge` command
mislav authored
78 Merge the pull request with a commit message that includes the pull request
79 ID and title, similar to the GitHub Merge Button.
e307ce9 @jfirebaugh Add `hub merge` command
jfirebaugh authored
80
3c6af16 @mislav magic `cherry-pick` supports GitHub commit URLs and "user@sha" notation
mislav authored
81 * `git cherry-pick` <GITHUB-REF>:
82 Cherry-pick a commit from a fork using either full URL to the commit
83 or GitHub-flavored Markdown notation, which is `user@sha`. If the remote
84 doesn't yet exist, it will be added. A `git fetch <user>` is issued
85 prior to the cherry-pick attempt.
86
26963ef @mislav add documentation about `hub apply`
mislav authored
87 * `git [am|apply]` <GITHUB-URL>:
005198e @mislav ability to cherry-pick pull requests and commits with `hub am`
mislav authored
88 Downloads the patch file for the pull request or commit at the URL and
26963ef @mislav add documentation about `hub apply`
mislav authored
89 applies that patch from disk with `git am` or `git apply`. Similar to
90 `cherry-pick`, but doesn't add new remotes. `git am` creates commits while
91 preserving authorship info while `apply` only applies the patch to the
92 working copy.
005198e @mislav ability to cherry-pick pull requests and commits with `hub am`
mislav authored
93
1cdda74 @mislav `git push remote1,remote2` without branch name pushes the current branch
mislav authored
94 * `git push` <REMOTE-1>,<REMOTE-2>,...,<REMOTE-N> [<REF>]:
624662f @defunkt update docs with new git-push info
defunkt authored
95 Push <REF> to each of <REMOTE-1> through <REMOTE-N> by executing
96 multiple `git push` commands.
97
691650a @mislav update man page to separate custom hub commands from git
mislav authored
98 * `git submodule add` [`-p`] <OPTIONS> [<USER>/]<REPOSITORY> <DIRECTORY>:
99 Submodule repository "git://github.com/<USER>/<REPOSITORY>.git" into
100 <DIRECTORY> as with git-submodule(1). When <USER>/ is omitted, assumes
101 your GitHub login. With `-p`, use private remote
102 "git@github.com:<USER>/<REPOSITORY>.git".
103
104 * `git help`:
105 Display enhanced git-help(1).
106
107 hub also adds some custom commands that are otherwise not present in git:
108
109 * `git create` [<NAME>] [`-p`] [`-d` <DESCRIPTION>] [`-h` <HOMEPAGE>]:
110 Create a new public GitHub repository from the current git
111 repository and add remote `origin` at
112 "git@github.com:<USER>/<REPOSITORY>.git"; <USER> is your GitHub
113 username and <REPOSITORY> is the current working directory name.
114 To explicitly name the new repository, pass in <NAME>, optionally in
115 <ORGANIZATION>/<NAME> form to create under an organization you're a
116 member of. With `-p`, create a private repository, and with `-d` and `-h`
117 set the repository's description and homepage URL, respectively.
118
de3ab41 @mislav browse/compare/cherry-pick: compensate for GitHub switch to HTTPS
mislav authored
119 * `git browse` [`-u`] [[<USER>`/`]<REPOSITORY>] [SUBPAGE]:
120 Open repository's GitHub page in the system's default web browser using
121 `open(1)` or the `BROWSER` env variable. If the repository isn't
122 specified, `browse` opens the page of the repository found in the current
123 directory. If SUBPAGE is specified, the browser will open on the specified
124 subpage: one of "wiki", "commits", "issues" or other (the default is
125 "tree").
11d96c3 @defunkt Add `hub browse` command for opening a repo in a browser.
defunkt authored
126
de3ab41 @mislav browse/compare/cherry-pick: compensate for GitHub switch to HTTPS
mislav authored
127 * `git compare` [`-u`] [<USER>] [<START>...]<END>:
cede3b9 @defunkt Add tests for `hub compare`
defunkt authored
128 Open a GitHub compare view page in the system's default web browser.
2155deb @joshthecoder Add "compare" command.
joshthecoder authored
129 <START> to <END> are branch names, tag names, or commit SHA1s specifying
670c984 @mislav replace two dots (`sha1..sha2`) with three in the `compare` command
mislav authored
130 the range of history to compare. If a range with two dots (`a..b`) is given,
131 it will be transformed into one with three dots. If <START> is omitted,
132 GitHub will compare against the base branch (the default is "master").
2155deb @joshthecoder Add "compare" command.
joshthecoder authored
133
282e905 Updated to use the newer ronn instead of ron.
Chris Brown authored
134 * `git fork` [`--no-remote`]:
21225f8 @mislav update manpage & readme tweaks. don't suggest to uninstall the "git-h…
mislav authored
135 Forks the original project (referenced by "origin" remote) on GitHub and
b4c5ea0 @mislav HUGE refactoring to transition to GitHub API v3 and OAuth
mislav authored
136 adds a new remote for it under your username.
6e444c7 @mislav `hub fork` forks a project on GitHub and adds the new remote
mislav authored
137
7c6b051 @mislav man formatting fix
mislav authored
138 * `git pull-request` [`-f`] [<TITLE>|`-i` <ISSUE>|<ISSUE-URL>] [`-b` <BASE>] [`-h` <HEAD>]:
7ae4895 @mislav refactor and improve `pull-request`
mislav authored
139 Opens a pull request on GitHub for the project that the "origin" remote
140 points to. The default head of the pull request is the current branch.
141 Both base and head of the pull request can be explicitly given in one of
142 the following formats: "branch", "owner:branch", "owner/repo:branch".
132eb6f @mislav `pull-request` aborts if unpushed commits; opens editor for title/body
mislav authored
143 This command will abort operation if it detects that the current topic
144 branch has local commits that are not yet pushed to its upstream branch
145 on the remote. To skip this check, use `-f`.
146
147 If <TITLE> is omitted, a text editor will open in which title and body of
148 the pull request can be entered in the same manner as git commit message.
7ae4895 @mislav refactor and improve `pull-request`
mislav authored
149
95a6dd5 @mislav improve pull-request
mislav authored
150 If instead of normal <TITLE> an issue number is given with `-i`, the pull
151 request will be attached to an existing GitHub issue. Alternatively, instead
152 of title you can paste a full URL to an issue on GitHub.
7ae4895 @mislav refactor and improve `pull-request`
mislav authored
153
3d4787e @rtomayko hub(1) manual page
rtomayko authored
154 ## CONFIGURATION
155
b4c5ea0 @mislav HUGE refactoring to transition to GitHub API v3 and OAuth
mislav authored
156 Hub will prompt for GitHub username & password the first time it needs to access
157 the API and exchange it for an OAuth token, which it saves in "~/.config/hub".
cff1869 @defunkt hub.http-clone config setting
defunkt authored
158
30e7ac3 @mislav opt in for HTTPS as git protocol: `hub config hub.protocol https`
mislav authored
159 If you prefer the HTTPS protocol for GitHub repositories, you can set
160 "hub.protocol" to "https". This will affect `clone`, `fork`, `remote add`
161 and other operations that expand references to GitHub repositories as full
162 URLs that otherwise use git and ssh protocols.
c2e575f @defunkt Support for GITHUB_USER and GITHUB_TOKEN env variables.
defunkt authored
163
30e7ac3 @mislav opt in for HTTPS as git protocol: `hub config hub.protocol https`
mislav authored
164 $ git config --global hub.protocol https
c2e575f @defunkt Support for GITHUB_USER and GITHUB_TOKEN env variables.
defunkt authored
165
48e774d @mislav man docs for Enterprise configuration
mislav authored
166 ### GitHub Enterprise
167
168 By default, hub will only work with repositories that have remotes which
169 point to github.com. GitHub Enterprise hosts need to be whitelisted to
170 configure hub to treat such remotes same as github.com:
171
172 $ git config --global --add hub.host my.git.org
173
174 The default host for commands like `init` and `clone` is still
175 github.com, but this can be affected with the <GITHUB_HOST> environment
176 variable:
177
178 $ GITHUB_HOST=my.git.org git clone myproject
179
a36bd94 @defunkt add EXAMPLES to man page
defunkt authored
180 ## EXAMPLES
181
01243c5 @mislav tired of duplicating examples between README & .ronn file
mislav authored
182 {{README}}
a36bd94 @defunkt add EXAMPLES to man page
defunkt authored
183
3d4787e @rtomayko hub(1) manual page
rtomayko authored
184 ## BUGS
185
42b1116 @mislav update old urls throughout documentation
mislav authored
186 <https://github.com/defunkt/hub/issues>
3d4787e @rtomayko hub(1) manual page
rtomayko authored
187
a01b256 @defunkt more than just me
defunkt authored
188 ## AUTHORS
3d4787e @rtomayko hub(1) manual page
rtomayko authored
189
a01b256 @defunkt more than just me
defunkt authored
190 <https://github.com/defunkt/hub/contributors>
3d4787e @rtomayko hub(1) manual page
rtomayko authored
191
192 ## SEE ALSO
193
194 git(1), git-clone(1), git-remote(1), git-init(1),
195 <http://github.com>,
42b1116 @mislav update old urls throughout documentation
mislav authored
196 <https://github.com/defunkt/hub>
Something went wrong with that request. Please try again.