Useful tips & tricks for GitHub. Mostly for me, but public so others might enjoy.
- Press
.
(period key) while browsing any repository or pull request on GitHub and it'll open that repo in the "web-based editor" github.dev. (docs)
- Use the command palette in GitHub to navigate, search, and run commands directly from your keyboard. (docs)
Command
+K
orCommand
+Option
+K
(Mac) orCtrl
+K
orCtrl
+Alt
+K
(Windows/Linux)
- You can specify the theme an image is displayed to by appending
#gh-dark-mode-only
or#gh-light-mode-only
to the end of an image URL, in Markdown.
- Press
?
on any page in GitHub to see all available keyboard shortcuts. - When viewing a file on GitHub.com, you can press the
y
key to update the URL to a permalink to the exact version of the file you see. (docs) - Toggle between the Write and Preview tabs
Command
+Shift
+P
(Mac) orCtrl
+Shift
+P
(Windows/Linux)
Many of these are simply keyboard shortcuts I use a lot. Check the docs on GitHub for many more.
- When viewing a repo on GitHub you can switch between the Code, Issues, Pull Requests, Actions, etc. tabs by typing
G
and the first letter of the Tabs title. For example,G
I
opens the issue tab,G
A
opens the Actions tab. - On the Code tab,
T
opens the file finder - On the Issues tab, typing
C
will create a new issue - When creating/editing an Issue,
A
allows you to set an assignee andL
applies a label.
A common example (for me) using several of the shortcuts above after landing on a repo page on GitHub:
G
I
to open the Issues tabC
to create a new issueA
to assign someoneL
to add labels
Check out the docs on basic formatting syntax for more info, these are just a few favorites
Note
Useful information that users should know, even when skimming content.
Tip
Helpful advice for doing things better or more easily.
Important
Key information users need to know to achieve their goal.
Warning
Urgent info that needs immediate user attention to avoid problems.
Caution
Advises about risks or negative outcomes of certain actions.
-
Mermaid is really awesome for flowcharts, sequence diagrams, gantt diagrams, class diagrams, and more
sequenceDiagram
participant User
participant API
participant Auth
participant Database
User ->> API: GET /api/thing
API ->> Auth: check auth
Auth ->> API: success
API ->> Database: get thing
Database ->> API: {the: thing}
API ->> User : 200 {the: thing}