Whether you're a professional programmer for a big software company or a hobbyist developer working on open-source projects, you're likely a frequent GitHub user. Just like with any other program that you use frequently, the better you know GitHub, the more you'll be able to use it in productive and creative ways.
As such, here are a few GitHub features and extensions that will help make you a more productive and creative GitHub user.
Searching in GitHub
Knowing the syntax of any search engine is crucial to speed up your work. Much of what you can search for using GitHub's advanced search can be searched for directly in its regular search bar.
To begin with, you can search in repository titles, descriptions, README files, code, commits, issues, pull, requests, ... using
in:readme, etc... followed by your search terms.
GitHub allows you to use
<= in your search query. This is useful when you're looking for repos that have a certain number of stars or topics connected to them. For example:
in:description space stars:>2500 would search for a repo with more than 2,500 stars that has the word space in its description.
Additionally, you can use
.. to search between a range.
in:description space stars:100..1000 would search for a repo that has between 100-1,000 stars with the word space in its description. Simple, once you know it!
Search becomes even more powerful when you combine the above with dates, using the
YYYY-MM-DD format. You can search for when a repo was
created or when something was last
pushed. For example:
in:description space stars:10..100 pushed:>2019-08-23 searches for a repo that has the word space in its description, has between 10 - 100 stars, and had its last push after the 23rd of August 2019.
Similarly, you can also search for
org:. Combine these all together and you'll have the power to search for whatever you want without needing to browse pages of repos.
Useful GitHub Keyboard Shortcuts
Knowing keyboard shortcuts can really speed up your work. Pressing
? in GitHub brings up its keyboard shortcuts. These are the ones I've found most useful.
/to focus on the search bar.
tto fuzzy search for files or inside files of a repo.
bin a file to open blame view.
yto create a URL permalink of a file that you can share knowing that the file won't change if changes are made to it.
Related to pressing
y for a URL permalink is
#L followed by a number, which you can use to indicate a specific line of code. You can create a range here, too. For example, adding
#L40-L45 will highlight line numbers 40-45 in a file.
Useful GitHub Extensions
Just like extensions to your IDE can help speed up your work, so can adding extensions to GitHub. Here are 6 GitHub extensions that can drastically improve your experience.
It also speeds up pull request reviews and, if you're willing to spend $29.95 a year, its pro version gives you the ability to switch between themes, enhanced code reviews, multiple GitHub accounts, and more.
OctoLinker is a Chrome extension that turns that turns language-specific statements like include require or import into links. It allows you to navigate through GitHub repos faster than you would usually.
Additionally, OctoLinker links dependencies in files like
requirements.txt to their related GitHub project page.
Stars Tagger is a Chrome extension that allows you to tag and categorize your starred repos, making it easier to search for the repo you want.
Alternatively, if you don't want to install a browser extension, you can use Astral to organize your starred GitHub repos.
GitHub npm stats is a simple Chrome extension that allows you to see the npm download stats of GitHub repos.
npmhub is a Chrome and Firefox extension that allows you to explore npm dependencies on GitHub (and GitLab) repos. It notices when you're browsing a repo with a
package.json file and displays each module's metadata on the GitHub page below the README.
Refined GitHub is a Chrome and Firefox extension that aims to improve many of GitHub's small annoyances. The extension has many features, including the ability to add reaction avatars showing who reacted to a comment, the option to wait for checks when merging a PR, and the ability to link issue/PR references in the code.
We've gone over powerful GitHub search functionality, 4 useful keyboard shortcuts, and 6 great GitHub extensions. Hopefully at least one of these will make you a faster and more productive developer.
What are your favorite GitHub features or extensions? Let me know in the comments below 👇.