From 5e057f3384a16ad0f5e8ba4cc27fb4004f64be1e Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Fri, 14 Aug 2015 16:48:42 -0500 Subject: [PATCH] Add Whitespace Warnings as a git til. --- README.md | 1 + git/whitespace-warnings.md | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 git/whitespace-warnings.md diff --git a/README.md b/README.md index 64c2f9e..f13a412 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [Stashing Only Unstaged Changes](git/stashing-only-unstaged-changes.md) - [Stashing Untracked Files](git/stashing-untracked-files.md) - [Verbose Commit Message](git/verbose-commit-message.md) +- [Whitespace Warnings](git/whitespace-warnings.md) ### go diff --git a/git/whitespace-warnings.md b/git/whitespace-warnings.md new file mode 100644 index 0000000..db51917 --- /dev/null +++ b/git/whitespace-warnings.md @@ -0,0 +1,13 @@ +# Whitespace Warnings + +You can configure git to warn you about whitespace issues in a file when you +diff it. This is handled by the `core.whitespace` configuration. Add the +following to your `.gitconfig` file: + +``` +[core] + whitespace = warn +``` + +By default, git will warn you of trailing whitespace at the end of a line as +well as blank lines at the end of a file.