GitHub Cheatsheet - Code Hosting Platform Shortcut Reference
Daily GitHub work — reviewing PRs, hunting files, leaving comments — is full of small repeated clicks. This reference covers global navigation (s and /), repo and file search, code search, Issue/PR hotkeys, review commenting, and Markdown editing. The big wins are keyboard-opened search and quick PR-review commenting. For maintainers and reviewers who spend hours in the browser rather than the terminal. After reading you review, search and comment faster than the mouse allows.
Typical Use Case
For developers who spend the day reading code, filing issues and reviewing pull requests on GitHub. The keyboard flow is where proficiency shows: G followed by a second letter moves you around the site without touching the mouse, taking you from opening a file to locating a line to leaving a comment in one uninterrupted sequence. Organised in six groups: global navigation, repository browsing, code browsing, issues and PRs, code review, and Markdown editing. Every entry is a key combination you can press directly.
Repository Browsing 8
TYWBIPCUCode Browsing 7
1-9Cmd + /Cmd + FCmd + GCmd + Shift + GCmd + Shift + FCmd + Shift + PIssues & PRs 11
CCmd + EnterCmd + Option + EnterCmd + Shift + PCmd + BCmd + ICmd + KCmd + Option + ICmd + Shift + 7Cmd + Shift + 8Cmd + Shift + 9Code Review 6
Cmd + EnterCmd + Option + EnterCmd + Shift + EnterCmd + Shift + 7Cmd + Shift + 8Cmd + Shift + 9Markdown Editing 10
Cmd + BCmd + ICmd + KCmd + Option + ICmd + Shift + 7Cmd + Shift + 8Cmd + Shift + 9Cmd + Shift + .Cmd + Shift + CCmd + Shift + HParameter matrix
| Parameter | Effect | Example |
|---|---|---|
G then N | Jump to the notifications page. | G N |
G then I / P / A | Jump to Issues, Pull requests or Actions. | G I |
T | Open the file finder. | T then type a file name |
Y | Pin the current URL to an immutable version of the file. | Y |
W / B | Toggle the branch label selector, or open an Issue template. | W |
1-9 | Jump straight to a line number in the file. | Press 4 to jump to line 4 |
Cmd+Enter | Submit the comment or the review. | Cmd+Enter |
Cmd+Option+Enter | Close the Issue or PR and leave a comment in one step. | Cmd+Option+Enter |
Cmd+Shift+Enter | Request changes during review. | Cmd+Shift+Enter |
Cmd+Shift+9 | Insert a todo list item in the - [ ] format. | Cmd+Shift+9 |
Cmd+Shift+C | Wrap the selection in a fenced code block. | Cmd+Shift+C |
? | Show the shortcut cheat sheet for the page you are on. | ? |
Common pitfalls
SymptomPressing G does nothing and the following keys land as plain characters.
CauseFocus is not on the page body; it is still inside the search box or a comment field.
FixClick an empty area of the page to return focus to the main region, then press G again.
SymptomCmd+Enter inserts a newline in the comment box instead of submitting.
CauseKey bindings differ per repository, or focus sits in the textarea where Enter keeps its normal meaning.
FixCheck the settings while focused in the comment box, and press ? to open the on-page shortcut table and confirm the real binding.
SymptomLine-number jumps do nothing on a long page that is hard to scan.
CauseThe file has not finished rendering, either because it is large or the network is slow.
FixWait for the page to load before pressing a digit, or open the file finder with T and jump to the file directly.
SymptomWhile reviewing a PR, Cmd+B inserts a search box instead of a link.
CauseFocus left the comment box, so the shortcut resolved against a different element.
FixAvoid clicking elsewhere on the page while writing a comment; link shortcuts such as Cmd+K only work while the comment box has focus.
SymptomCmd+Enter submitted the review comment even though todo checkboxes were still unticked.
CauseThe - [ ] items inserted with Cmd+Shift+9 are plain text and do not block submission.
FixEdit the checkbox state below the comment after submitting; before a formal review, press ? to check the actual submit binding.
SymptomY in a PR was expected to pin the file link but the URL still shows the branch name.
CauseInline links in a review diff can be pinned, but the full-page URL has to be pinned from the file view.
FixOpen the specific file view first, then press Y, and confirm the address bar contains a commit SHA.
SymptomA G sequence lands on an unexpected page, for example G then W opens the branch selector.
CauseGitHub resolves G sequences by page context, so the same key means different things in different views.
FixPress ? to read the shortcut table for the current page; if a jump fails, navigate to the target through the address bar instead.
Troubleshooting
1Unsure which shortcuts the current page supports
?GitHub pops up the full shortcut table for the current context, which is the authoritative answer.
2Find a file quickly and jump to a specific line
T then type the file name, then press 1-9It is a two-step move: locate the file first, then jump to the line — far faster than scrolling a long page.
3Turn the current file URL into a permanent link
YProduces a link containing the commit SHA, which is safe to reference in comments or documentation.
4Submit a review verdict
Cmd+Shift+EnterRequests changes; Cmd+Enter submits a plain comment, Cmd+Option+Enter closes and comments at the same time.
5Insert a code block or a todo list
Cmd+Shift+CCmd+Shift+9 inserts the - [ ] format, which turns review feedback into a trackable checklist.
Command Examples
Markdown shortcuts in the comment box
Cmd + B // bold
Cmd + I // italic
Cmd + K // insert a link
Cmd + Shift + 7 // ordered list
Cmd + Shift + 8 // unordered list
Cmd + Shift + 9 // task listThe GitHub comment box renders Markdown, so shortcuts beat typing symbols. Task-list items from Cmd + Shift + 9 are real checkboxes that reviewers can tick — far more actionable than writing "please follow up" in prose.
The three ways to land a review
Cmd + Enter // submit the comment
Cmd + Option + Enter // approve the pull request
Cmd + Shift + Enter // request changesApproval can immediately satisfy required reviews and unblock a merge; requesting changes blocks it outright. Finish your comments before pressing submit, and do not turn a plain comment into an approval by accident.
Adding single-line, multi-line, and TODO comments in the diff
Cmd + Shift + 7 // add a single-line comment
Cmd + Shift + 8 // add a multi-line comment
Cmd + Shift + 9 // add a todo commentThese keys insert lists in the editor but attach comments in the Files changed view. They pin feedback to an exact line and follow it as the diff evolves — far more reliable than writing "line 42" in prose.
Permalinks: references that do not go stale
Y // turn the current URL into a fixed referenceA default branch URL keeps changing as code moves on. Paste one into an issue, a discussion, or an incident record and months later readers land on entirely different code. Convert it to a permalink before referencing it.
Read code by keyboard: file finder plus line jump
T // open the file finder
1-9 // jump to that line number
Cmd + / // toggle a line commentThe file finder fuzzy-matches by name and opens on Enter; once open, 1-9 jumps to a line and Cmd + / toggles a line comment. In an unfamiliar repository this replaces most scrolling and mouse work.
Jump across GitHub by keyboard
G then I // Issues
G then P // Pull Requests
G then C // Projects
G then A // ActionsActions is the first stop when CI fails: G then A opens the run list, and expanding the failed run drills into individual job logs — far fewer clicks than navigating from the repo home.
Common Pitfalls
- force push overwrites commits other people already pushed to the same branch; they survive only in the reflog. Fetch and verify on a shared branch, or always go through a PR.
- On a protected branch only Maintainers and Owners can usually force push or delete; developer pushes are rejected outright, so do not count on rescuing it locally.
- Appending a fix commit after a PR is merged pollutes history. Once merged, revert or open a new PR.
- Cmd + Enter and Cmd + Option + Enter sit side by side: hitting the latter with your review still half-written approves the PR and submits none of your comments.
- A repository GITHUB_TOKEN used by an Actions workflow gets no write access for fork PRs by default. Tighten or change permissions and CI turns red, usually with nothing more specific than a permissions error.
- Pinning Actions caches or dependencies to mutable tags such as latest makes reruns irreproducible — you cannot distinguish a code change from dependency drift.
Tips
- The T key opens the file finder - much faster than clicking, with fuzzy filename matching.
- The Y key converts the URL to a permalink (commit hash) to share a specific version.
- Cmd+Enter submits a comment, Cmd+Option+Enter closes and comments - no button clicking.
- During code review, Cmd+Shift+7 quickly adds a single-line comment.
- The Markdown editor supports Cmd+B bold, Cmd+I italic, Cmd+K insert link.
- The ? key shows all keyboard shortcuts - check anytime.
FAQ
Why do shortcuts do nothing while my cursor is in an input box?
When the focus sits in a text field, comment editor or search box, GitHub hands the keystroke to that field instead of the page, so single-key navigation such as T, W or Y never fires. Press Esc or click an empty area of the page to blur the field and the shortcuts come back. The other escape hatch is help: press ? for the keyboard shortcut sheet, or open the command palette with Cmd + Shift + P — typing / inside a text field also raises the palette, and that one does work while focused.
How do I jump straight to notifications, pull requests or Actions?
Each is a G-then-letter sequence: G then N for notifications, G then I for Issues, G then P for Pull Requests, G then C for Projects, G then D for Discussions, G then A for Actions and G then W for the Wiki. Press T for the file finder within a repository, and S or / to search. When you are unsure of a mapping, ? opens the complete keyboard shortcut sheet.
How do I make sure my colleagues are looking at exactly the code I am?
Press Y to convert the current URL to a permanent version pinned to a commit hash, then share that link — without it, the other person can drift onto a newer commit and see different code. If you need to look at a different ref first, press W to open the branch/tag selector. Inside a file, the number keys 1 through 9 jump straight to a line, Cmd + F searches the current file, Cmd + Shift + F searches the whole repository, and Cmd + G / Cmd + Shift + G step between matches.
What shortcuts speed up writing a pull request description?
In the Markdown editor, Cmd + B bolds, Cmd + I italicises, Cmd + K inserts a link and Cmd + Option + I an image; Cmd + Shift + 7, 8 and 9 give ordered, unordered and task lists; Cmd + Shift + H, Cmd + Shift + C and Cmd + Shift + . handle headings, code blocks and quotes. Cmd + Enter submits the comment in one action, and Cmd + Shift + P switches between writing and preview.
Which keys do I press to approve or request changes during review?
Cmd + Enter submits your review, Cmd + Option + Enter approves the pull request outright, and Cmd + Shift + Enter requests changes. For inline feedback use Cmd + Shift + 7 for a single-line comment, Cmd + Shift + 8 for a multi-line comment and Cmd + Shift + 9 for a todo comment. Cmd + / toggles commenting on the whole line when you need to discuss a block of code at once.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Jul 21, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us