tldr/pages/common/hub.md

34 lines
1011 B
Markdown
Raw Normal View History

2016-02-14 17:49:56 +03:00
# hub
> A wrapper for git that adds commands for working with GitHub-based projects.
2016-02-14 17:49:56 +03:00
> The commands can also be used using "git" instead of "hub".
2019-06-07 13:58:31 +03:00
> More information: <https://hub.github.com>.
2016-02-14 17:49:56 +03:00
- Clone a repository you own, using just the repository name rather than the full URL:
2016-02-14 17:49:56 +03:00
2016-02-16 01:12:54 +03:00
`hub clone {{repo_name}}`
2016-02-14 17:49:56 +03:00
- Clone another user's repository, using their github username and the repository name:
2016-02-14 17:49:56 +03:00
`hub clone {{username}}/{{repo_name}}`
2016-02-14 17:49:56 +03:00
- Create a fork of the current repository (cloned from another user) under your github profile:
`hub fork`
- Push the current local branch to github and create a PR for it in the original repository:
`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`
- Create a new branch with the contents of a pull request and switch to it:
`hub pr checkout {{pr_number}}`
- Upload the current (local-only) repository to your github account:
2016-02-14 17:49:56 +03:00
`hub create`