Skip to content

izabellalbuquerque/github-shortcuts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Essential GitHub Shortcuts and Tips

greatly enhance your workflow. GitHub is a powerful platform for version control, collaboration, and project management, and knowing how to navigate it efficiently is key to boosting productivity. This guide contains a list of essential GitHub keyboard shortcuts and includes additional tips, tricks, and best practices to help you make the most of the platform. Whether you’re working on open-source projects, reviewing pull requests, or managing repositories, this resource will save you time and effort.

Table of Contents

Key Keyboard Shortcuts

GitHub provides a range of keyboard shortcuts to streamline navigation and repetitive tasks. Below is an expanded list of the most useful shortcuts to help you work faster.

1. Global Search

  • Shortcut: /
  • Description: Opens the global GitHub search bar, allowing you to search for repositories, issues, pull requests, users, or code across all of GitHub. Use this to quickly locate resources without navigating through menus.
  • Pro Tip: Combine with advanced search syntax (e.g., from:username or repo:owner/repo) for precise results.

2. Navigate Repository Tabs

  • Shortcuts:
    • g + c: Go to the Code tab to view the repository's codebase.
    • g + i: Go to the Issues tab to manage or view issues.
    • g + p: Go to the Pull Requests tab to review or create PRs.
    • g + b: Go to the Projects tab to access the project board.
    • g + w: Go to the Wiki tab for repository documentation.
    • g + a: Go to the Actions tab to monitor CI/CD workflows.
  • Description: These shortcuts allow you to switch between different sections of a repository without clicking through the interface.
  • Pro Tip: Memorize these combinations to move seamlessly between tabs during code reviews or project planning.

3. Create a New Issue

  • Shortcut: c
  • Description: Opens the form to create a new issue in the current repository. This is perfect for quickly reporting bugs or suggesting features.
  • Pro Tip: Use issue templates (if available in the repository) to ensure consistent and detailed issue reports.

4. Navigate to Notifications

  • Shortcut: g + n
  • Description: Takes you to your notifications page, where you can see mentions, issue assignments, PR reviews, and other activities.
  • Pro Tip: Use filters like is:unread or reason:mention in the notifications search bar to focus on critical updates.

5. File Search in Repository

  • Shortcut: t
  • Description: Activates the file finder, letting you search for and jump to any file in the repository.
  • Pro Tip: Use arrow keys to navigate search results and press Enter to open a file directly.

6. Submit a Comment

  • Shortcut: Cmd + Enter (Mac) or Ctrl + Enter (Windows/Linux)
  • Description: Submits a comment on an issue or pull request without needing to click the "Comment" button.
  • Pro Tip: Use Markdown in your comments to add formatting, code snippets, or checklists for clarity.

7. Quick Repository Search

  • Shortcut: g + r
  • Description: Opens a search bar to find repositories you have access to, including personal and organization repos.
  • Pro Tip: This is especially useful if you work across multiple organizations or have many repositories.

8. View All Shortcuts

  • Shortcut: ?
  • Description: Displays a comprehensive list of GitHub keyboard shortcuts in a pop-up window.
  • Pro Tip: Keep this shortcut handy until you’ve memorized the ones you use most frequently.

9. View Commit History

  • Shortcut: g + l
  • Description: Navigates to the Commits tab, where you can review the repository’s commit history.
  • Pro Tip: Use the commit search bar to filter commits by author, date, or keyword.

10. Scroll to Top

  • Shortcut: Shift + ?
  • Description: Instantly scrolls back to the top of a long page, such as a lengthy issue thread or file list.
  • Pro Tip: Combine with t to jump to a file after returning to the top.

11. Additional Useful Shortcuts

  • Blame View: b
    • Opens the blame view for a file, showing who last modified each line and when.
  • Toggle Line Comments: Cmd + / (Mac) or Ctrl + / (Windows/Linux)
    • Adds a comment to a specific line in a pull request’s diff view.
  • Open Pull Request: p
    • Opens the form to create a new pull request in the current repository.
  • Switch Branches/Tags: w
    • Opens the branch/tag selector to switch between branches or tags in the repository.

Advanced Navigation Tips

Beyond shortcuts, GitHub offers features to enhance navigation and productivity:

  • Fuzzy Search in File Finder: When using the t shortcut, GitHub’s file finder supports fuzzy search, so you don’t need to type the exact file name.
  • Advanced Search Queries: Use GitHub’s search bar (/) with qualifiers like is:open, is:pr, or language:python to narrow down results.
  • Bookmark Repositories: Star or pin frequently accessed repositories to your GitHub dashboard for quick access.
  • Keyboard Navigation in PRs: When reviewing pull requests, use j and k to navigate between changed files in the diff view.

GitHub Productivity Features

To complement shortcuts, leverage these GitHub features to streamline your workflow:

1. GitHub Actions

  • Automate repetitive tasks like testing, building, or deploying code using GitHub Actions. Set up workflows in the .github/workflows directory.
  • Example: Create a CI pipeline to run tests on every push to the main branch.

2. Issue and PR Templates

  • Use templates to standardize bug reports, feature requests, or pull request descriptions. Add them to your repository under .github/ISSUE_TEMPLATE/ or .github/pull_request_template.md.
  • Example: Include sections for reproduction steps, expected behavior, and screenshots in a bug report template.

3. Saved Replies

  • Save frequently used comments (e.g., “Thanks for the PR!” or “Please add tests”) to reuse them in issues or PRs.
  • Access saved replies in the comment box dropdown.

4. Project Boards

  • Use GitHub Projects to organize tasks with Kanban boards. Automate task movement (e.g., moving an issue to “In Progress” when a PR is opened).
  • Access with g + b.

5. Code Review Tools

  • Use @mentions to request reviews from specific team members.
  • Add line-specific comments in PRs with Cmd + / or Ctrl + /.

Best Practices for Using GitHub

To maximize efficiency and collaboration, follow these best practices:

  1. Write Clear Commit Messages: Use descriptive messages (e.g., “Fix bug in login validation”) to make the commit history (g + l) easier to navigate.
  2. Use Branches Effectively: Create feature branches for each task and use pull requests (p) for code reviews.
  3. Leverage Labels and Milestones: Organize issues (g + i) with labels like bug, enhancement, or urgent and group them into milestones for releases.
  4. Enable Notifications Wisely: Customize notifications (g + n) to avoid being overwhelmed. Focus on mentions and assignments.
  5. Document with Wikis: Use the Wiki tab (g + w) to maintain project documentation, such as setup instructions or FAQs.
  6. Review PRs Efficiently: Use shortcuts like Cmd + Enter to comment and b for blame view to understand code changes.

Additional Resources

Conclusion

Mastering GitHub shortcuts and features can transform your workflow, saving you time and reducing repetitive tasks. By incorporating these shortcuts, leveraging GitHub’s productivity tools, and following best practices, you’ll navigate repositories, collaborate on projects, and manage tasks like a pro. Start small by memorizing a few shortcuts (like / for search or t for file finder) and gradually integrate more into your daily routine.

About

Guide with essential shortcuts and practical tips to navigate and be more productive on GitHub.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors