1hub(1) hub manual hub(1)
2
3
4
6 hub - make git easier with GitHub
7
9 hub [--noop] COMMAND [OPTIONS]
10 hub alias [-s] [SHELL]
11 hub help hub-COMMAND
12
14 Hub is a tool that wraps git in order to extend it with extra
15 functionality that makes it better when working with GitHub.
16
18 Available commands are split into two groups: those that are already
19 present in git but that are extended through hub, and custom ones that
20 hub provides.
21
22 Extended git commands
23 hub-am(1)
24 Replicate commits from a GitHub pull request locally.
25
26 hub-apply(1)
27 Download a patch from GitHub and apply it locally.
28
29 hub-checkout(1)
30 Check out the head of a pull request as a local branch.
31
32 hub-cherry-pick(1)
33 Cherry-pick a commit from a fork on GitHub.
34
35 hub-clone(1)
36 Clone a repository from GitHub.
37
38 hub-fetch(1)
39 Add missing remotes prior to performing git fetch.
40
41 hub-init(1)
42 Initialize a git repository and add a remote pointing to GitHub.
43
44 hub-merge(1)
45 Merge a pull request locally with a message like the GitHub Merge
46 Button.
47
48 hub-push(1)
49 Push a git branch to each of the listed remotes.
50
51 hub-remote(1)
52 Add a git remote for a GitHub repository.
53
54 hub-submodule(1)
55 Add a git submodule for a GitHub repository.
56
57 New commands provided by hub
58 hub-alias(1)
59 Show shell instructions for wrapping git.
60
61 hub-api(1)
62 Low-level GitHub API request interface.
63
64 hub-browse(1)
65 Open a GitHub repository in a web browser.
66
67 hub-ci-status(1)
68 Display status of GitHub checks for a commit.
69
70 hub-compare(1)
71 Open a GitHub compare page in a web browser.
72
73 hub-create(1)
74 Create a new repository on GitHub and add a git remote for it.
75
76 hub-delete(1)
77 Delete a repository on GitHub.
78
79 hub-fork(1)
80 Fork the current repository on GitHub and add a git remote for it.
81
82 hub-pull-request(1)
83 Create a GitHub Pull Request.
84
85 hub-pr(1)
86 Manage GitHub Pull Requests for the current repository.
87
88 hub-issue(1)
89 Manage GitHub Issues for the current repository.
90
91 hub-release(1)
92 Manage GitHub Releases for the current repository.
93
94 hub-sync(1)
95 Fetch git objects from upstream and update local branches.
96
98 Most hub commands are supposed to be run in a context of an existing
99 local git repository. Hub will automatically detect the GitHub
100 repository that the current working directory belongs to by scanning
101 its git remotes.
102
103 In case there are multiple git remotes that are all pointing to GitHub,
104 hub assumes that the main one is named "upstream", "github", or
105 "origin", in that order of preference.
106
107 When working with forks, it's recommended that the git remote for your
108 own fork is named "origin" and that the git remote for the upstream
109 repository is named "upstream". See
110 ⟨https://help.github.com/articles/configuring-a-remote-for-a-fork/⟩
111
112 The default branch (usually "master") for the current repository is
113 detected like so:
114
115 git symbolic-ref refs/remotes/origin/HEAD
116
117 where origin is the name of the git remote for the upstream repository.
118
119 The destination where the currently checked out branch is considered to
120 be pushed to depends on the git config push.default setting. If the
121 value is "upstream" or "tracking", the tracking information for a
122 branch is read like so:
123
124 git rev-parse --symbolic-full-name BRANCH@{upstream}
125
126 Otherwise, hub scans git remotes to find the first one for which
127 refs/remotes/REMOTE/BRANCH exists. The "origin", "github", and
128 "upstream" remotes are searched last because hub assumes that it's more
129 likely that the current branch is pushed to your fork rather than to
130 the canonical repo.
131
133 GitHub OAuth authentication
134 Hub will prompt for GitHub username password the first time it needs
135 to access the API and exchange it for an OAuth token, which it saves in
136 ~/.config/hub.
137
138 To avoid being prompted, use GITHUB_USER and GITHUB_PASSWORD
139 environment variables.
140
141 Alternatively, you may provide GITHUB_TOKEN, an access token with repo
142 permissions. This will not be written to ~/.config/hub.
143
144 HTTPS instead of git protocol
145 If you prefer the HTTPS protocol for git operations, you can configure
146 hub to generate all URLs with https: instead of git: or ssh::
147
148 $ git config --global hub.protocol https
149
150 This will affect clone, fork, remote add and other hub commands that
151 expand shorthand references to GitHub repo URLs.
152
153 GitHub Enterprise
154 By default, hub will only work with repositories that have remotes
155 which point to github.com. GitHub Enterprise hosts need to be
156 whitelisted to configure hub to treat such remotes same as github.com:
157
158 $ git config --global --add hub.host MY.GIT.ORG
159
160 The default host for commands like init and clone is still github.com,
161 but this can be affected with the GITHUB_HOST environment variable:
162
163 $ GITHUB_HOST=my.git.org git clone myproject
164
165 Environment variables
166 HUB_VERBOSE
167 Enable verbose output from hub commands.
168
169 HUB_CONFIG
170 The file path where hub configuration is read from and stored. If
171 XDG_CONFIG_HOME is present, the default is $XDG_CONFIG_HOME/hub;
172 otherwise it's $HOME/.config/hub. The configuration file is also
173 searched for in XDG_CONFIG_DIRS per XDG Base Directory
174 Specification.
175
176 HUB_PROTOCOL
177 Use one of "https|ssh|git" as preferred protocol for git
178 clone/push.
179
180 GITHUB_TOKEN
181 OAuth token to use for GitHub API requests.
182
184 ⟨https://github.com/github/hub/issues⟩
185
187 ⟨https://github.com/github/hub/contributors⟩
188
190 git(1), git-clone(1), git-remote(1), git-init(1),
191 ⟨https://github.com/github/hub⟩
192
193
194
195
196hub version 2.11.2 22 Apr 2019 hub(1)