Is there an easy way to automatically do a git checkout on any file that only has whitespace changes? I\'m dealing with both Windows and some code generation that\'s run from Ec
(there’s probably a smarter way but this works for me)
mybranch=master
git checkout -b tmp origin/master
# compute the non-ws diff to mybranch and apply it
git diff -U0 -w --no-color $mybranch | git apply -R --cached --ignore-whitespace --unidiff-zero -
git commit -m "non ws changes"
git reset --hard # discard all non-staged data
Your now on a new "tmp" branch. You may want to clean up (NOTE: this loses history of $mybranch
)
git checkout $mybranch
git reset --hard tmp
git branch -D tmp