From 0b062dbbfd25b3a3c6cd359d181f4b9290fb392a Mon Sep 17 00:00:00 2001 From: Michael Schlapa Date: Wed, 14 Apr 2021 09:35:38 +0200 Subject: [PATCH] Line endings and whitespaces in Git --- git/README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/git/README.md b/git/README.md index 270cde7..74d1793 100644 --- a/git/README.md +++ b/git/README.md @@ -13,3 +13,25 @@ lola = log --graph --decorate --pretty=oneline --abbrev-commit --all diff = diff --ws-error-highlight=all ``` + +### Line ending settings + +On Windows: + +``` +git config core.autocrlf true +``` + +On Linux (should be default): +``` +git config core.autocrlf input +``` + +## Show whitespace errors + +Also works with `git diff`: + +``` +git show --ws-error-highlight=new,old +``` +