2016-02-14 14:49:56 +00:00
|
|
|
# hub
|
|
|
|
|
2019-01-04 16:21:22 +00:00
|
|
|
> A wrapper for git that adds commands for working with GitHub-based projects.
|
2019-11-22 01:35:56 +00:00
|
|
|
> If set up as instructed by `hub alias`, one can use `git` to run `hub` commands.
|
2019-06-07 11:58:31 +01:00
|
|
|
> More information: <https://hub.github.com>.
|
2016-02-14 14:49:56 +00:00
|
|
|
|
2016-12-21 22:55:12 +00:00
|
|
|
- Clone a repository you own, using just the repository name rather than the full URL:
|
2016-02-14 14:49:56 +00:00
|
|
|
|
2016-02-15 22:12:54 +00:00
|
|
|
`hub clone {{repo_name}}`
|
2016-02-14 14:49:56 +00:00
|
|
|
|
2021-01-07 14:19:35 +00:00
|
|
|
- Clone another user's repository, using their GitHub username and the repository name:
|
2016-02-14 14:49:56 +00:00
|
|
|
|
2016-12-21 22:55:12 +00:00
|
|
|
`hub clone {{username}}/{{repo_name}}`
|
2016-02-14 14:49:56 +00:00
|
|
|
|
2021-01-07 14:19:35 +00:00
|
|
|
- Create a fork of the current repository (cloned from another user) under your GitHub profile:
|
2016-09-09 17:18:38 +01:00
|
|
|
|
|
|
|
`hub fork`
|
|
|
|
|
2021-01-07 14:19:35 +00:00
|
|
|
- Push the current local branch to GitHub and create a PR for it in the original repository:
|
2016-09-09 17:18:38 +01:00
|
|
|
|
2019-01-04 16:21:22 +00:00
|
|
|
`hub push {{remote_name}} && hub pull-request`
|
|
|
|
|
|
|
|
- Create a PR of the current (already pushed) branch, reusing the message from the first commit:
|
|
|
|
|
|
|
|
`hub pull-request --no-edit`
|
2016-09-09 17:18:38 +01:00
|
|
|
|
2019-07-05 22:06:57 +01:00
|
|
|
- Create a new branch with the contents of a pull request and switch to it:
|
|
|
|
|
|
|
|
`hub pr checkout {{pr_number}}`
|
|
|
|
|
2021-01-07 14:19:35 +00:00
|
|
|
- Upload the current (local-only) repository to your GitHub account:
|
2016-02-14 14:49:56 +00:00
|
|
|
|
2016-12-21 22:55:12 +00:00
|
|
|
`hub create`
|