git2 Min Read

Git shortcuts - Helpful shortcuts for git users

Gorav Singal

May 30, 2019

TL;DR

Learn keyboard shortcuts for GitHub's web interface including file search, code navigation, and other productivity-enhancing features for everyday repository use.

Git shortcuts - Helpful shortcuts for git users

Github is an awesome place of storing your code. Now, it also allows you to have private repositories for free. But, only projects in your personal account, not in your organization.

Github web view provides lot of shortcuts which increase your productivity. Here, I will list down only those shortcuts which are very useful:

1. Search Files in Github repository

Make sure you are in Code tab in your repository. There is a shortcut of going there as well. Look below in this post.

Press 't' button

This activates file finder. Now, start typing some name. As you type it will start searching. It will start showing the list of matching files in below area. And, you can select them using up and down arrow keys.

2. Switch to other branch or create new one

Press 'w' button

This will activates the Branches drop down, and you can start typing which branch you want to select. Or, you can create a new branch by typing a new name. Plus, you can also switch to a tag

First goto that file either by browsing, or by searching by pressing ‘t’ button. Now, when you have opened up a file.

Press 'y' button

The URL in browser expands to give you the direct link to this file. Note, you were already to the direct link of that file. But, that link will always to latest file in that branch. This link will give you always this file, which includes the commit id as well.

4. Search anything in repository

Press 's' or '/' button

You will goto search bar on top. Now start typing anything you want to search.

5. Goto Your Notifications

Press 'gn' i.e. first 'g', then 'n'

6. Goto Code tab

Press 'gc', i.e. first 'g' then 'c'

Similarly you can goto other tabs as well:

'gi' for Issues tab
'gp' for Pull requests tab
'gb' for Projects tab
'gw' for Wiki tab
Share

Related Posts

A Practical Guide in understanding Git Branch and Conflict resolution during merge

A Practical Guide in understanding Git Branch and Conflict resolution during merge

Introduction In this guide, We will learn about branching, handling conflict…

A Practical Guide on Understanding Git Best Practices

A Practical Guide on Understanding Git Best Practices

Introduction In this post, we will learn about some of Best practices while…

A Practical Guide on how to work with Git Basic Commands and workflows

A Practical Guide on how to work with Git Basic Commands and workflows

Introduction In this guide, we will see git basic commands, and fundamentals of…

A Practical Guide on how to work with Git log command and history

A Practical Guide on how to work with Git log command and history

Introduction In this post, we will see ways to look at git history logs. For…

A Practical Guide on how to to create your own git command alias

A Practical Guide on how to to create your own git command alias

Introduction In this guide, We will learn on how to create some handy command…

A Practical Guide for better understanding Git Diff

A Practical Guide for better understanding Git Diff

Introduction In this guide, We will get basic understanding of various options…

Latest Posts

Supply Chain Security — Protecting Your Software Pipeline

Supply Chain Security — Protecting Your Software Pipeline

In 2024, a single malicious contributor nearly compromised every Linux system on…

Security Ticketing and Incident Response

Security Ticketing and Incident Response

The worst time to figure out your incident response process is during an…

Security Mindset for Engineers — Think Like an Attacker

Security Mindset for Engineers — Think Like an Attacker

Most engineers think about security the way they think about flossing — they…

Secrets Management — Vault, SSM, and Secrets Manager

Secrets Management — Vault, SSM, and Secrets Manager

I’ve watched a production database get wiped because someone committed a root…

Penetration Testing Basics for Developers

Penetration Testing Basics for Developers

Most developers think of penetration testing as something a separate security…

OWASP Top 10 for Cloud Applications

OWASP Top 10 for Cloud Applications

The OWASP Top 10 was written for traditional web applications. But in the cloud…