Skip to content

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 shortcutsdescription
S or /Focus on the search bar. For more information, see "About searching on GitHub”。
G NGo to your notifications. For more information, see "About notifications”。
EscWhen 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 shortcutsdescription
G CGo to Code tab
G IGo to the Issues tab. For more information, see "On the topic”。
G PGo toPull requests tab. For more information, see "About pull requests”。
G AGo to the Actions tab. For more information, see "See "About Actions."”。
G BGo to the Projects tab. For more information, see "About the project board”。
G WGo to the Wiki tab. For more information, see "About the wiki”。
G GGo to the Discussions tab. For more information, see "About the discussion”。

Source code editing

Keyboard shortcutsdescription
.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
EOpen 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+GSkip to row
Command+Z (Mac) or Ctrl+Z (Windows/Linux)undo
Command+Y (Mac) or Ctrl+Y (Windows/Linux)redo
Command+Shift+PSwitch 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 shortcutsdescription
TActivate File Finder
LJump to a line in the code
WSwitch to a new branch or tag
YExpand the URL into its canonical form. For more information, see "Gets a permalink to a file”。
IShow or hide comments about differences. For more information, see "Comment on the difference in pull requests”。
AShow or hide comments on differences
BOpen the retrospective view. For more information, see "Track changes in files”。

comments

Keyboard shortcutsdescription
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”。
RQuote the selected text in your reply. For more information, see "Basic compose and formatting syntax”。

List of issues and pull requests

Keyboard shortcutsdescription
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”。
UFilter by author
LFilter or edit tags by tags. For more information, see "Filter issues and pull requests by tags”。
Alt and clickWhen filtering by tags, exclude tags. For more information, see "Filter issues and pull requests by tags”。
MFilter or edit milestones by milestones. For more information, see "Filter issues and pull requests by milestone”。
AFilter or edit assignees by assignee. For more information, see "Filter issues and pull requests by assignee”。
O or EnterOpen the issue

Issues and pull requests

Keyboard shortcutsdescription
QRequest a reviewer. For more information, see "Request a pull request review”。
MSet milestones. For more information, see "Associate milestones with issues and pull requests”。
LApply a label. For more information, see "Apply labels to issues and pull requests”。
ASet up assignees. For more information, see "Assign issues and pull requests to other GitHub users”。
XLink 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 clickWhen 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 clickWhen 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 shortcutsDescription
COpen the commit list in the pull request
TOpen the list of changed files in the pull request
JMove the selection down in the list
KMove the selection up in the list
Command+Shift+EnterAdd a comment about the pull request discrepancy
Alt and ClickBy 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-clickClick 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 shortcutsdescription
Enter or SpaceStart moving the focused column
EscCancel the move in progress
EnterComplete the move in progress
← or HMove 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 LMove 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 shortcutsDescription
Enter or SpaceStart moving the focused card
EscCancel the move in progress
EnterComplete the move in progress
↓ or JMove 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 KMove 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 HMove the card to the bottom of the left column
Shift+← or Shift+HMove 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+LMove 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描述
EscClose the card preview pane

GitHub Actions

Keyboard shortcutsdescription
Command+Space (Mac) or Ctrl+Space (Windows/Linux)In the workflow editor, get suggestions for workflow files.
G FGo to the workflow file
Shift+T or TToggle the timestamp in the log
Shift+F or FToggle the full-screen log
EscExit the full-screen log

notice

Keyboard shortcutsdescription
EMark as complete
Shift+UMark as unread
Shift+IMark as read
Shift+MCancel your subscription

Network diagram

Keyboard shortcutsdescription
← or HScroll left
→ or LScroll to the right
↑ or KScroll up
↓ or JScroll 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
最近更新