diff --git a/README.md b/README.md index 8785d7b..7d46cdb 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Specific fetch reference](#specific-fetch-reference) * [Find common ancestor of two branches](#find-common-ancestor-of-two-branches) * [List unpushed git commits](#list-unpushed-git-commits) +* [Add everything, but whitespace changes](#add-everything-but-whitespace-changes) @@ -996,5 +997,10 @@ git log @{u}.. git cherry -v ``` +## Add everything, but whitespace changes +```sh +git diff --ignore-all-space | git apply --cached +``` + diff --git a/tips.json b/tips.json index 0d44021..fcd7e7c 100644 --- a/tips.json +++ b/tips.json @@ -425,4 +425,7 @@ "title": "List unpushed git commits", "tip": "git log --branches --not --remotes", "alternatives": ["git log @{u}..", "git cherry -v"] -}] +}, { + "title": "Add everything, but whitespace changes", + "tip": "git diff --ignore-all-space | git apply --cached" +}] \ No newline at end of file