Use GitHub keyboard shortcuts to summarize
The source address of this article:https://docs.github.com/cn/get-started/using-github/keyboard-shortcuts
Keyboard shortcuts
Almost every page on GitHub has keyboard shortcuts to perform actions faster.
About keyboard shortcuts
Enter? A dialog box pops up listing the keyboard shortcuts available for the page. You can use these keyboard shortcuts to perform actions on your site without navigating with the mouse.
You can disable character key shortcuts in accessibility settings while still allowing shortcuts that modify keys. For more information, see "Manage accessibility settings”。
Here's a list of some of the available keyboard shortcuts.
GitHub Command Palette also gives you quick access to a variety of actions without having to remember keyboard shortcuts. For more information, see "GitHub Command Palette”。
Site shortcuts
Keyboard shortcuts | description |
---|---|
S or / | Focus on the search bar. For more information, see "About searching on GitHub”。 |
G N | Go to your notifications. For more information, see "About notifications”。 |
Esc | When focusing on a user, issue, or pull request hover card, close the hover card and refocus on the element where the hover card is located |
Command+K (Mac)
或or Ctrl+K (Windows/Linux)
| Open the GitHub Command Palette. If you want to edit the Markdown text, use Command+Option+K
or Ctrl+Alt+K
to open the Command Palette. For more information, see "GitHub Command Palette”。
warehouse
Keyboard shortcuts | description |
---|---|
G C | Go to Code tab |
G I | Go to the Issues tab. For more information, see "On the topic”。 |
G P | Go toPull requests tab. For more information, see "About pull requests”。 |
G A | Go to the Actions tab. For more information, see "See "About Actions."”。 |
G B | Go to the Projects tab. For more information, see "About the project board”。 |
G W | Go to the Wiki tab. For more information, see "About the wiki”。 |
G G | Go to the Discussions tab. For more information, see "About the discussion”。 |
Source code editing
Keyboard shortcuts | description |
---|---|
. | Open a repository or pull request in a web-based editor. For more information,see "Web-based editor”。 |
Command+B (Mac) or Ctrl+B (Windows/Linux) | Insert Markdown formatting for bold text |
Command+I (Mac) or Ctrl+I (Windows/Linux) | Insert Markdown formatting for italic text |
Command+K (Mac) or Ctrl+K (Windows/Linux) | Insert the Markdown format to create a link |
Command+Shift+7 (Mac) orCtrl+Shift+7 (Windows/Linux) | Insert the Markdown format for the ordered list |
Command+Shift+8 (Mac) or Ctrl+Shift+8 (Windows/Linux) | Inserts the Markdown format for unordered lists |
Command+Shift+. (Mac) or Ctrl+Shift+. (Windows/Linux) | Insert the Markdown format for the quote |
E | Open the source code file in the Edit file tab |
Command+F (Mac) or Ctrl+F (Windows/Linux) | Start searching in the file editor |
Command+G (Mac) or Ctrl+G (Windows/Linux) | Find the next one |
Command+Shift+G (Mac) or Ctrl+Shift+G (Windows/Linux) | Find the previous one |
Command+Option+F (Mac) 或 Ctrl+Shift+F (Windows/Linux) | replacement |
Command+Shift+Option+F (Mac) or Ctrl+Shift+R (Windows/Linux) | Replace all |
Alt+G | Skip to row |
Command+Z (Mac) or Ctrl+Z (Windows/Linux) | undo |
Command+Y (Mac) or Ctrl+Y (Windows/Linux) | redo |
Command+Shift+P | Switch between the Edit file and Preview changes tabs |
Command+S (Mac) or Ctrl+S (Windows/Linux) | Fill in the submission message |
For more keyboard shortcuts, seeCodeMirror documentation。
Source code browsing
Keyboard shortcuts | description |
---|---|
T | Activate File Finder |
L | Jump to a line in the code |
W | Switch to a new branch or tag |
Y | Expand the URL into its canonical form. For more information, see "Gets a permalink to a file”。 |
I | Show or hide comments about differences. For more information, see "Comment on the difference in pull requests”。 |
A | Show or hide comments on differences |
B | Open the retrospective view. For more information, see "Track changes in files”。 |
comments
Keyboard shortcuts | description |
---|---|
Command+B (Mac) or Ctrl+B (Windows/Linux) | Insert Markdown formatting for bold text |
Command+I (Mac) or Ctrl+I (Windows/Linux) | Insert Markdown formatting for italic text |
Command+E (Mac) or Ctrl+E (Windows/Linux) | Insert the Markdown format of the code or command in the line |
Command+K (Mac) or Ctrl+K (Windows/Linux) | Insert the Markdown format used to create the link |
Command+V (Mac) or Ctrl+V (Windows/Linux) | Create a Markdown link when applied to highlighted text |
Command+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux) | Switch between the Write and Preview comment tabs |
Command+Shift+V (Mac) orCtrl+Shift+V (Windows/Linux) | Paste the HTML link as plain text |
Command+Shift+Opt+V (Mac) or Ctrl+Shift+Alt+V (Windows/Linux) | Paste the HTML link as plain text |
Command+Shift+7 (Mac) or Ctrl+Shift+7 (Windows/Linux) | Insert the Markdown format for the ordered list |
Command+Shift+8 (Mac) or Ctrl+Shift+8 (Windows/Linux) | Inserts the Markdown format for unordered lists |
Command+Enter (Mac) or Ctrl+Enter (Windows/Linux) | Submit a review |
Ctrl+.,And then Ctrl+[The number of the saved reply] | Open the Saved Replies menu and use the saved replies to autofill the comment fields. For more information, see "About saved replies”。 |
Command+Shift+. (Mac) or Ctrl+Shift+. (Windows/Linux) | Insert the Markdown format for the quote |
Command+G (Mac) or Ctrl+G (Windows/Linux) | Insert a suggestion. For more information, see "Review the proposed changes in the pull request”。 |
R | Quote the selected text in your reply. For more information, see "Basic compose and formatting syntax”。 |
List of issues and pull requests
Keyboard shortcuts | description |
---|---|
C | 创建议题 |
Command+/ (Mac) or Ctrl+/ (Windows/Linux) | Focus your cursor on the issue or pull request search bar. For more information, see "Filter and search for issues and pull requests”。 |
U | Filter by author |
L | Filter or edit tags by tags. For more information, see "Filter issues and pull requests by tags”。 |
Alt and click | When filtering by tags, exclude tags. For more information, see "Filter issues and pull requests by tags”。 |
M | Filter or edit milestones by milestones. For more information, see "Filter issues and pull requests by milestone”。 |
A | Filter or edit assignees by assignee. For more information, see "Filter issues and pull requests by assignee”。 |
O or Enter | Open the issue |
Issues and pull requests
Keyboard shortcuts | description |
---|---|
Q | Request a reviewer. For more information, see "Request a pull request review”。 |
M | Set milestones. For more information, see "Associate milestones with issues and pull requests”。 |
L | Apply a label. For more information, see "Apply labels to issues and pull requests”。 |
A | Set up assignees. For more information, see "Assign issues and pull requests to other GitHub users”。 |
X | Link issues or pull requests from the same repository. For more information, see "Link the pull request to the issue”。 |
Command+Shift+P (Mac) 或 Ctrl+Shift+P (Windows/Linux) | Switch between the Write and Preview tabs |
Alt and click | When creating an issue from the task list, hold down Alt and click in the upper-right corner of the task to open the new issue form in the current tab. For more information, see "About the task list”。 |
Shift and click | When creating an issue from the task list, hold down Shift and click in the upper-right corner of the task to open the new issue form in a new tab. For more information, see "About the task list”。 |
Command and click (Mac) or Ctrl+Shift and click (Windows/Linux) | When creating an issue from the task list, hold down Command or Ctrl+Shift and click in the upper-right corner of the task to open the new issue form in a new window. For more information, see "About the task list”。 |
Changes in pull requests
Keyboard shortcuts | Description |
---|---|
C | Open the commit list in the pull request |
T | Open the list of changed files in the pull request |
J | Move the selection down in the list |
K | Move the selection up in the list |
Command+Shift+Enter | Add a comment about the pull request discrepancy |
Alt and Click | By pressing Alt and clicking Show outdated or Hide outdated,Toggle between collapsing and expanding all expired review comments in a pull request. |
Click, and then Shift-click | Click a line number, hold down Shift, and then click another line number to comment on multiple lines of a pull request. For more information, see "Comment on the pull request”。 |
Project board
Move columns
Keyboard shortcuts | description |
---|---|
Enter or Space | Start moving the focused column |
Esc | Cancel the move in progress |
Enter | Complete the move in progress |
← or H | Move the column to the left |
Command+← or Command+H (Mac) or Ctrl+← or Ctrl+H (Windows/Linux) | Move the column to the leftmost position |
→ or L | Move the column to the right |
Command+→ or Command+L (Mac) or Ctrl+→ or Ctrl+L (Windows/Linux) | Move the column to the rightmost position |
Move the card
Keyboard shortcuts | Description |
---|---|
Enter or Space | Start moving the focused card |
Esc | Cancel the move in progress |
Enter | Complete the move in progress |
↓ or J | Move the card down |
Command+↓ or Command+J (Mac) or Ctrl+↓ or Ctrl+J (Windows/Linux) | Move the card to the bottom of the column |
↑ or K | Move the card up |
Command+↑ or Command+K (Mac) or Ctrl+↑ or Ctrl+K (Windows/Linux) | Move the card to the top of the column |
← or H | Move the card to the bottom of the left column |
Shift+← or Shift+H | Move the card to the top of the left column |
Command+← or Command+H (Mac) or Ctrl+← or Ctrl+H (Windows/Linux) | Move the card to the bottom of the leftmost column |
Command+Shift+← or Command+Shift+H (Mac) or Ctrl+Shift+← or Ctrl+Shift+H (Windows/Linux) | Move the card to the top of the leftmost column |
→ | Move the card to the bottom of the right column |
Shift+→ or Shift+L | Move the card to the top of the right column |
Command+→ or Command+L (Mac) or Ctrl+→ or Ctrl+L (Windows/Linux) | Move the card to the bottom of the rightmost column |
Command+Shift+→ or Command+Shift+L (Mac) or Ctrl+Shift+→ or Ctrl+Shift+L (Windows/Linux) | Move the card to the bottom of the rightmost column |
Preview the card
Keyboard shortcuts | 描述 |
---|---|
Esc | Close the card preview pane |
GitHub Actions
Keyboard shortcuts | description |
---|---|
Command+Space (Mac) or Ctrl+Space (Windows/Linux) | In the workflow editor, get suggestions for workflow files. |
G F | Go to the workflow file |
Shift+T or T | Toggle the timestamp in the log |
Shift+F or F | Toggle the full-screen log |
Esc | Exit the full-screen log |
notice
Keyboard shortcuts | description |
---|---|
E | Mark as complete |
Shift+U | Mark as unread |
Shift+I | Mark as read |
Shift+M | Cancel your subscription |
Network diagram
Keyboard shortcuts | description |
---|---|
← or H | Scroll left |
→ or L | Scroll to the right |
↑ or K | Scroll up |
↓ or J | Scroll down |
Shift+← (Mac) or Shift+H (Windows/Linux) | Scroll all the way to the left |
Shift+→ (Mac) or Shift+L (Windows/Linux) | Scroll all the way to the right |
Shift+↑ (Mac) or Shift+K (Windows/Linux) | Scroll all the way up |
Shift+↓ (Mac) or Shift+J (Windows/Linux) | Scroll all the way up down |