Created
March 12, 2013 16:19
-
-
Save halilim/5144287 to your computer and use it in GitHub Desktop.
Discards files with only newline changes. Main idea from http://stackoverflow.com/questions/12092714/how-to-git-reset-hard-everything-but-4-files NOTE: Test it first without checking out actually!!!
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
# Windows: doesn't work in Git Bash, use Cygwin (with cd "D:\etc..." first) | |
for file in $(git diff --ignore-space-at-eol --stat=1000,1000|cut -d' ' -f2|head -n -1); do git add $file; done && git checkout . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment