As the end of the year rapidly approaches, I've been reflecting and looking for ways to increase my productivity in the next year.
For some time I've been considering integrating GitHub CLI in my workflow, aiming to reduce the back and forth between the terminal and the GitHub web UI.
Since I interact with pull requests pretty much everyday, several times a day, that's where I'll focus mainly.
Listing some useful commands below for reference.
Open repository in the web browser
List open PRs
gh pr list
Get status of relevant PRs
gh pr status
View PR in the browser
gh pr view --web
Checkout a PR
gh pr checkout
Accepts PR number or branch name.
Create a PR
gh pr create
It's also possible to skip the interactive PR creation, by directly specify the title and body:
gh pr create --title "PR title" --body "PR body"
- To mark PR as draft use option
- To open the web browser to create the PR use option
gh pr close
- To leave a closing comment use option
- To delete the local and remote branch after close use option
The entire list of available commands and respective documentation can be found here.