From b445df5dbf87e8a87398b6234591206a1f499177 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Fri, 21 Oct 2016 08:57:52 -0500 Subject: [PATCH] Add Exclude Whitespace From GitHub Diffs as an internet til --- README.md | 3 ++- .../exclude-whitespace-from-github-diffs.md | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 internet/exclude-whitespace-from-github-diffs.md diff --git a/README.md b/README.md index 7de3d66..fbd21c3 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really warrant a full blog post. These are mostly things I learn by pairing with smart people at [Hashrocket](http://hashrocket.com/). -_483 TILs and counting..._ +_484 TILs and counting..._ --- @@ -161,6 +161,7 @@ _483 TILs and counting..._ ### Internet - [Add Emoji To GitHub Repository Description](internet/add-emoji-to-github-repository-description.md) +- [Exclude Whitespace From GitHub Diffs](internet/exclude-whitespace-from-github-diffs.md) ### JavaScript diff --git a/internet/exclude-whitespace-from-github-diffs.md b/internet/exclude-whitespace-from-github-diffs.md new file mode 100644 index 0000000..37795d4 --- /dev/null +++ b/internet/exclude-whitespace-from-github-diffs.md @@ -0,0 +1,20 @@ +# Exclude Whitespace From GitHub Diffs + +If you run a tidy ship and use plugins like +[vim-spacejam](https://github.com/rondale-sc/vim-spacejam), then whitespace +changes cluttering up your git diffs probably isn't much of an issue. + +However, if you are working with other people or messier code bases, then +you may not be so lucky. If there are a bunch of whitespace changes in a +commit, then that is going to make the diff view of a commit on GitHub +annoying, and perhaps hard, to read. + +You can cut to the chase by excluding whitespace changes from GitHub's diff +view by adding `w=1` to the diff URL. + +Check out [this view of the +diff](https://github.com/jbranchaud/dotfiles/commit/fad58dfda91e61972b3c28e7e967bb631140e71e) +and then [this view of the diff that excludes +whitespace](https://github.com/jbranchaud/dotfiles/commit/fad58dfda91e61972b3c28e7e967bb631140e71e?w=1). + +[source](https://twitter.com/ablwr/status/789141645098938368)