Github HotKeys

GitHub is a widely used platform for version control and collaboration. Using keyboard shortcuts can significantly improve your efficiency on the platform.

GitHub Windows Shortcut Keys

Site wide shortcuts

Shortcut Action
S Focus the search bar
G N Go to your notifications
H Opens and focuses on a user, issue, or pull request hovercard
Esc When focused on above, closes hovercard

Repositories

Shortcut Action
G C Go to the Code tab
G I Go to the Issues tab
G P Go to the Pull requests tab
G B Go to the Projects tab
G W Go to the Wiki tab

Source code editing

Shortcut Action
Ctrl F Start searching in file editor
Ctrl G Find next
Ctrl Shift G Find previous
Ctrl Shift F Replace
Ctrl Shift R Replace all
Alt G Jump to line
Ctrl Z Undo
Ctrl Y Redo

Source code browsing

Shortcut Action
T Activates the file finder
L Jump to a line in your code
W Switch to a new branch or tag
Y Expand a URL to its canonical form
I Show or hide comments on diffs
B Open blame view

Comments

Shortcut Action
Ctrl B Inserts Markdown formatting for bolding text
Ctrl I Inserts Markdown formatting for italicizing text
Ctrl K Inserts Markdown formatting for creating a link
Ctrl Shift P Toggles between the Write and Preview comment tabs
Ctrl Enter Submits a comment
Ctrl . Opens saved replies menu and then autofills comment field with a saved reply
Ctrl G Inserts a suggestions
R Quote the selected text in your reply

Issue and pull request lists

Shortcut Action
C Create an issue
Ctrl / Focus your cursor on the issues or pull requests search bar
U Filter by author
L Filter by or edit labels
M Filter by or edit milestones
A Filter by or edit assignee
O Open issue

Issues and pull requests

Shortcut Action
Q Request a reviewer
M Set a milestone
L Apply a label
A Set an assignee

Changes in pull requests

Shortcut Action
C Open the list of commits in the pull request
T Open the list of changed files in the pull request
J Move selection down in the list
K Move selection up in the list
Ctrl Shift Enter Add a single comment on a pull request diff
Alt (click) Toggle between collapsing and expanding all outdated review comments in a pull request

Project boards

Shortcut Action
Enter/Space Start moving the focused column
Esc Cancel the move in progress
Enter Complete the move in progress
Left/H Move column to the left
Ctrl Left/H Move column to the leftmost position
Right/L Move column to the right
Ctrl Right/L Move column to the rightmost position
Enter/Space Start moving the focused card
Esc Cancel the move in progress
Enter Complete the move in progress
Down/J Move card down
Ctrl Down/J Move card to the bottom of the column
Up/K Move card up
Ctrl Up/K Move card to the top of the column
Left/H Move card to the bottom of the column on the left
Shift Left/H Move card to the top of the column on the left
Ctrl Left/H Move card to the bottom of the leftmost column
Ctrl Shift Left/H Move card to the top of the leftmost column
Right Move card to the bottom of the column on the right
Shift Right/L Move card to the top of the column on the right
Ctrl Right/L Move card to the bottom of the rightmost column
Ctrl Shift Right/L Move card to the top of the rightmost column

Notifications

Shortcut Action
E/L/Y Mark as read
Shift M Mute thread

Network graph

Shortcut Action
Left/H Scroll left
Right/L Scroll right
Up/K Scroll up
Down/J Scroll down
Shift Left/H Scroll all the way left
Shift Right/L Scroll all the way right
Shift Up/K Scroll all the way up
Shift Down/J Scroll all the way down

GitHub macOS Shortcut Keys

Global Navigation

Shortcut Description
s Focus on the search bar
g n Go to notifications
g d Go to the dashboard

Repository Browsing

Shortcut Description
g c Show code tab
g i Show issues tab
t Search for a file by name (within a repository's code page)
l Go to a specific line number (when viewing a source code file)
. (period) Open the repository or pull request in the github.dev editor in the same browser tab (requires login)
> (greater than) Open the repository or pull request in the github.dev editor in a new browser tab (requires login)

Issues and Pull Requests Lists

Shortcut Description
c Create a new issue
Command + / Focus on the issue or pull request search bar
u Filter by author
l Filter by label or edit labels
Option + Click Exclude a label when filtering
m Filter by milestone or edit milestones
a Filter by assignee or edit assignees
o or Enter Activate an issue

Issues and Pull Requests (Detailed)

Shortcut Description
q Request reviewers
m Set a milestone
l Apply labels
a Set assignees
x Link issues or pull requests from the same repository
Command + Shift + p Toggle between the "Write" and "Preview" tabs
Option + Click When creating an issue from a task list, open the new issue form in the current tab
Shift + Click When creating an issue from a task list, open the new issue form in a new tab
Command + Click When creating an issue from a task list, open the new issue form in a new window
Option + Shift + c Create a new sub-issue
Option + Shift + a Add an existing issue as a sub-issue
Option + Shift + p Edit the parent issue
Command + b Insert Markdown for bold text
Command + i Insert Markdown for italic text
Command + k Insert Markdown for creating a link
Command + Shift + 7 Insert Markdown for an ordered list
Command + Shift + 8 Insert Markdown for an unordered list
Command + Shift + . Insert Markdown for a blockquote

Code File Navigation and Editing

Shortcut Description
Shift + j Highlight the currently selected line(s) in a code file.
Shift + Option + c If a code line is currently selected, this shortcut opens the line menu for that line.
Command + Enter Highlights the code symbol currently selected by the cursor and all other occurrences of the symbol in the code, and shows the symbol in the Symbols pane.
e Open a source code file in the "Edit file" tab.
Command + f Start a search in the file editor
Command + g Find next
Command + Shift + g Find previous
Command + Option + f Replace
Command + Shift + Option + f Replace all
Alt + g Go to line
Command + z Undo
Command + y Redo
Command + s Write a commit message

Changes in Pull Requests

Shortcut Description
c Open the list of commits in a pull request
t Open the list of changed files in a pull request
j Move the selection down in the lists
k Move the selection up in the lists
Command + Shift + Enter Add a comment on a pull request diff
Option + Click Toggle between collapsing and expanding all outdated review comments in a pull request by pressing Option and clicking Show outdated or Hide outdated.
Click, then Shift + Click Comment on multiple lines of a pull request by clicking a line number, holding Shift, and then clicking another line number.

About GitHub

GitHub is a web-based platform that provides hosting for software development and version control using Git. It offers distributed version control and source code management (SCM) functionality of Git, plus its own features.

GitHub Official Information

GitHub Shortcut Keys FAQs

  1. Are these shortcuts available on all GitHub pages?
    No, some shortcuts are specific to certain pages like repository code pages or issue/pull request pages.

  2. Do these shortcuts work in GitHub Desktop?
    GitHub Desktop has its own set of shortcuts. Please refer to the official documentation for GitHub Desktop shortcuts.

  3. Can I customize these shortcuts?
    No, GitHub does not currently offer a way to customize keyboard shortcuts.

  4. Where can I find the most up-to-date list of shortcuts?
    The official GitHub documentation is the best source for the most current information.

  5. Do these shortcuts work in all browsers?
    Yes, these shortcuts should generally work in all modern browsers.

  6. Are there shortcuts for commenting on code?
    While there aren't dedicated shortcuts for commenting in the same way IDEs provide, using the "reply" function on comments or using the "edit" function on your own comments can be expedited with standard browser shortcuts like Ctrl+Enter (or Command+Enter on macOS) to submit.

  7. What if a shortcut isn't working?
    Double-check that you are on the correct page where the shortcut is applicable. Also, ensure there are no browser extensions or other software interfering with the shortcuts.

Conclusion

By mastering these GitHub shortcut keys, you can significantly enhance your workflow and become more productive on the platform. Remember to refer to the official documentation for the latest information and more specific shortcuts.

5/5 - (1 vote)