2020-02-17 02:30:39 +00:00
|
|
|
# gh
|
|
|
|
|
2021-05-20 21:13:41 +01:00
|
|
|
> Work seamlessly with GitHub from the command-line.
|
2021-09-13 09:21:21 +01:00
|
|
|
> Some subcommands such as `gh config` have their own usage documentation.
|
2020-02-17 02:30:39 +00:00
|
|
|
> More information: <https://cli.github.com/>.
|
|
|
|
|
2021-01-17 17:56:17 +00:00
|
|
|
- Clone a GitHub repository locally:
|
2020-02-17 02:30:39 +00:00
|
|
|
|
2020-10-24 14:46:22 +01:00
|
|
|
`gh repo clone {{owner}}/{{repository}}`
|
2020-02-17 02:30:39 +00:00
|
|
|
|
2020-10-24 14:46:22 +01:00
|
|
|
- Create a new issue:
|
2020-02-17 02:30:39 +00:00
|
|
|
|
2020-10-24 14:46:22 +01:00
|
|
|
`gh issue create`
|
2020-02-17 02:30:39 +00:00
|
|
|
|
2021-01-17 17:56:17 +00:00
|
|
|
- View and filter the open issues of the current repository:
|
2020-02-17 02:30:39 +00:00
|
|
|
|
2020-10-24 14:46:22 +01:00
|
|
|
`gh issue list`
|
2020-02-17 02:30:39 +00:00
|
|
|
|
2020-10-24 14:46:22 +01:00
|
|
|
- View an issue in the browser:
|
2020-02-17 02:30:39 +00:00
|
|
|
|
2020-10-24 14:46:22 +01:00
|
|
|
`gh issue view --web {{issue_number}}`
|
2020-02-17 02:30:39 +00:00
|
|
|
|
2020-10-24 14:46:22 +01:00
|
|
|
- Create a pull request:
|
2020-10-13 11:37:01 +01:00
|
|
|
|
2020-10-24 14:46:22 +01:00
|
|
|
`gh pr create`
|
2020-10-13 11:37:01 +01:00
|
|
|
|
2020-10-24 14:46:22 +01:00
|
|
|
- View a pull request in the browser:
|
2020-02-17 02:30:39 +00:00
|
|
|
|
2020-10-24 14:46:22 +01:00
|
|
|
`gh pr view --web {{pr_number}}`
|
2020-02-17 02:30:39 +00:00
|
|
|
|
2021-01-17 17:56:17 +00:00
|
|
|
- Locally check out the branch of a pull request, given its number:
|
2020-02-17 02:30:39 +00:00
|
|
|
|
2020-10-24 14:46:22 +01:00
|
|
|
`gh pr checkout {{pr_number}}`
|
2020-02-17 02:30:39 +00:00
|
|
|
|
2020-10-24 14:46:22 +01:00
|
|
|
- Check the status of a repository's pull requests:
|
2020-02-17 02:30:39 +00:00
|
|
|
|
2020-10-24 14:46:22 +01:00
|
|
|
`gh pr status`
|