Cheat Sheet Library

GitHub & GitHub CLI Cheat Sheet

gh brings pull requests, issues, Actions and releases into your terminal. Install with winget install GitHub.cli, brew install gh or sudo apt install gh.

  • 54 entries
  • 9 sections
  • Updated
  • Click a command to see all its options

54 entries

On this page

Setup #

CommandAction
Log in (browser or token)
Check login
Use gh as the Git credential helper

Repositories #

CommandAction
Create a new repo and clone it
Publish the current folder as a new repo
Clone
Fork and clone
Open the repo in the browser
Open the current repo / file in the browser
Your repos

Pull Requests #

CommandAction
Create a PR from the current branch (title/body from commits)
Create as a draft
Open PRs
PRs relevant to you
Check out PR #42 locally
Open in the browser
Show the diff
CI status
Approve (--request-changes -b "..." to request changes)
Squash-merge and clean up
Mark a draft as ready

Issues #

CommandAction
New issue (interactive)
Issues assigned to you
Show an issue
Close
Create a branch linked to the issue

Actions (CI/CD) #

CommandAction
Recent workflow runs
Follow a run live
Logs of the failed steps
Re-run the failed jobs
Workflows
Trigger a workflow manually
Add a repository secret

Releases & Gists #

CommandAction
Release with automatic notes
Attach files
Download assets
Share a snippet

Misc #

CommandAction
Search GitHub
Call the REST API directly
Create your own shortcut
Add extensions

GitHub Website Shortcuts #

KeyAction
?Show all shortcuts
/ or sSearch
tFile finder in a repo
.Open the repo in the web editor (github.dev)
yTurn the URL into a permalink to this exact commit
bBlame view (on a file)
lJump to a line (on a file)
g c / g i / g pCode / Issues / Pull requests tab

Markdown Magic in Issues & PRs #

WriteEffect
Fixes #12 in a PR descriptionCloses issue 12 when the PR is merged
@usernameMention someone
- [ ] taskCheckbox
> [!NOTE] / > [!WARNING]Colored alert boxes
Drag an image inUpload and embed