Github keyboard shortcuts to move around faster and productively

Table of Contents

If you often browse Github repositories on your browser, chances are you find yourself moving between files, jumping between lines, reviewing diffs and other common source code related tasks. Github has a list of commands[1] and keyboard shortcuts[2] to move around faster.

Here are the keyboard shortcuts that I find myself using more often to navigate and interact with Github repositories:

  • Ctrl + k: Open command palette with fuzzy search
    • From here you make a wide range of actions by just writting: where you want to, or what you want to do
    • Search is fuzzy, so you don’t even need to type the complete command, or even correctly
    • Navigate between tabs, just type: issues, PRs, Actions, Settings
    • Navigate between repositories: delete the repository name, and start writing a different one which belogs to the user or organization
    • Run commands by typing >. From here one can run things like: creating an issue, close a pull request or updating the current branch
  • t: File finder
    • When you know the name of the file you are looking for, or part of it, just start typing it to filter the possible results
    • Easy to filter by extension or some other pattern in the file name: type part of the name, then . followed by the extension to filter further
  • l: Go to line
    • With a file opened, jump directly to some line by typing the number
  • w: Switch to a branch or tag
    • To quickly change to some branch or tag if you know the name or part of the name of it
  • e: Edit file
    • I don’t find myself using this one much, but some quick or small changes it may be useful when you are not working with your local editor
  • .: Open in web editor
    • If not working in your own machine, only have access to a browser, or don’t have access to your everyday source code editor or IDE, this option gives you an online IDE. It is an online instance of VSCode, with all of its features, one of the outcomes of Microsoft buying Github.

Full reference of the keyboard shortctus and command palette options:

Github command palette Full list of Github keyboard shortcuts

References

- [1]: https://docs.github.com/en/get-started/using-github/github-command-palette

- [2]: https://docs.github.com/en/get-started/using-github/keyboard-shortcuts