Tool cheatsheet
GitHub CLI 2 Cheatsheet
Work with repositories, pull requests, issues, workflow runs and releases from your terminal with gh.
Setup and repositories
- Check the gh version — Print the installed GitHub CLI version.
- Sign in to GitHub — Authenticate gh through a browser or a token.
- Check who you are signed in as — Show the accounts and token scopes gh has.
- Clone a repository — Clone with your preferred protocol.
- Create a repository from the current folder — Create a public repository on GitHub, set it as origin and push.
- Fork a repository — Fork a repository and clone your fork.
- Open the repository in a browser — Open the repository, or a file or PR, on github.com.
Pull requests
- Create a pull request — Open a pull request for the current branch, filling the title and body from your commits.
- List pull requests — Show open pull requests in the repository.
- Check out a pull request — Fetch a pull request's branch and switch to it.
- View a pull request — Open a pull request in the browser.
- Check CI status — Show the status of checks on a pull request.
- Approve a pull request — Submit an approving review.
- Squash-merge and delete the branch — Merge a pull request as a single commit and delete its branch.
Issues
- Create an issue — Open a new issue with a title and body.
- List your assigned issues — Show open issues assigned to you.
- Close an issue — Close an issue with a comment.
- Create a branch for an issue — Create and check out a branch linked to the issue.
Actions and releases
- List workflow runs — Show recent runs of your workflows.
- Watch a run — Follow a run until it finishes. Choose the run from a list.
- See why a run failed — Print the logs of the failed steps of a run.
- Re-run failed jobs — Re-run only the jobs that failed.
- Trigger a workflow — Start a workflow that has a workflow_dispatch trigger.
- Create a release — Create a release for a tag with generated notes.
- Set a repository secret — Store a secret for GitHub Actions. You are prompted for the value.
- Call the GitHub API — Make an authenticated API request. {owner} and {repo} are filled in from the current repository.
- Create a shortcut — Define an alias, here for listing your open PRs.
Related cheatsheets
- Ansible 2 cheatsheet — Run ad-hoc commands and playbooks, manage inventories, roles, collections and secrets with Ansible.
- Argo CD 3 cheatsheet — Install Argo CD, define Applications declaratively, and manage sync, diffs, history and rollbacks with the argocd CLI.
- AWS CLI 2 cheatsheet — Configure credentials and manage S3, EC2, Lambda, logs, containers and secrets with the AWS CLI v2.
- Azure CLI 2 cheatsheet — Sign in and manage resource groups, VMs, web apps, storage, Kubernetes, registries and secrets with the az command.
- Bash and Linux 5 cheatsheet — Everyday shell and Linux commands for files, searching text, permissions, processes and servers.
- Claude API cheatsheet — Call Claude from Python, TypeScript or curl: messages, streaming, thinking, tools, structured output, caching, batches and error handling.