I went through this course recently and learned some handy GitHub workflow tricks. Here are the most useful ones I found.
Pressing “t” in a repository opens up the File Finder. You can then type the name of any file in the repo for quick access.
GitHub URLs are very flexible for visualizing diffs in your projects. Below are a few ways to do this.
Diffs between two tags
This URL shows how to compare the diff between two git tags: https://github.com/sinatra/sinatra/compare/0.9.4…1.0.a
Diffs between dates
This URL shows how to compare the master branch to how it looked 1 month ago: https://github.com/sinatra/sinatra/compare/[email protected]%7B1month%7D…master
Passing “w=1” as a URL parameter to the diff compare URL causes it to exclude whitespace commits. This makes visualization much cleaner when simple code formatting changes were made in addition to functional changes. This parameter can also be used on pull request pages.
Before “w” option:
after “w” option:
Sharing specific lines in files
Use shift + click to select lines in files. This will append a parameter to the URL, which allows for easy bookmarking or sharing. https://blog.mariusschulz.com/2015/07/25/sharing-line-highlights-in-github-files
Direct URLs for forking repos
Appending “/fork” onto the repo URL for any repo will take you to the “fork repo” dialog page. It’s a little thing, but can speed up workflow or instructions that involve having others fork a repo.
Instantly view the public keys a user has uploaded by appending “.keys” to their profile URL. One use case for this would be for DevOps to automate provisioning of SSH access to systems.