Fundamentals 6 min read

Master GitHub: 10 Hidden Tricks to Boost Your Workflow

Discover practical GitHub shortcuts—including diff whitespace ignoring, author commit filtering, branch comparison URLs, Gist embedding, short URL creation, line highlighting, quick quoting, task lists, and diff/patch retrieval—to streamline your development workflow and save time.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Master GitHub: 10 Hidden Tricks to Boost Your Workflow

GitHub is widely used, but many useful tricks remain unknown. This article shares a collection of handy GitHub tips.

Ignore whitespace in diffs

Append ?w=1 to the URL to hide whitespace changes.

View an author’s commit history

Add ?author=username to the URL, for example:

https://github.com/rails/rails/commits/master?author=dhh

Compare branches

Use a URL like the following to compare branches:

https://github.com/rails/rails/compare/master...4-1-stable

You can also use date‑based or relative references:

https://github.com/rails/rails/compare/master@{1.day.ago}...master
https://github.com/rails/rails/compare/master@{2014-10-04}...master

To compare with a fork, prepend the fork name:

https://github.com/rails/rails/compare/byroot:master...master

Embed a Gist via HTML

Gists provide JavaScript embed code, but many sites block it. Append .pibb to a Gist URL to get a pure‑HTML version that can be copied directly, e.g., https://gist.github.com/tiimgreen/10545817.pibb.

Git.io short URLs

Git.io offers short URLs for GitHub links.

You can create a short link with curl:

$ curl -i http://git.io -F "url=https://github.com/..."
HTTP/1.1 201 Created
Location: http://git.io/abc123

$ curl -i http://git.io/abc123
HTTP/1.1 302 Found
Location: https://github.com/...

You can also specify a custom code:

$ curl -i http://git.io -F "url=https://github.com/technoweenie" \
    -F "code=t"
HTTP/1.1 201 Created
Location: http://git.io/t

Highlight specific lines

Add #L52 to a file URL to highlight line 52, or use a range like #L53-L60. You can also click line numbers while holding Shift.

https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60

Quick quote

Select a comment and press r; the text is copied as a quoted block into the comment box.

Task lists

In issues or pull requests, use the task‑list syntax:

- [ ] Be awesome
- [ ] Do stuff
- [ ] Sleep

After checking items, the Markdown updates to:

- [x] Be awesome
- [x] Do stuff
- [ ] Sleep

Diff and patch of a pull request

Append .diff or .patch to a pull‑request URL to view the raw diff or patch:

https://github.com/tiimgreen/github-cheat-sheet/pull/15.diff
https://github.com/tiimgreen/github-cheat-sheet/pull/15.patch

The result is plain text:

diff --git a/README.md b/README.md
index 88fcf69..8614873 100644--- a/README.md)
+++ b/README.md
@@ -28,6 +28,7 @@ ...
- [ ] Sleep

(...)
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

workflowGitHubVersion ControlshortcutsTips
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.