Last active
March 14, 2023 21:09
-
-
Save mmrko/7d2922ed821d45265fbd to your computer and use it in GitHub Desktop.
git add files ignoring whitespace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# props: https://stackoverflow.com/questions/3515597/add-only-non-whitespace-changes#answer-7149602 | |
git diff -U0 -w --no-color | git apply --cached --ignore-whitespace --unidiff-zero |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To add an alias (e.g.
ganw
) for it in your~/.bashrc
(or alike):source ~/.bashrc
or open a new terminal tab to make it available.