Last active
December 20, 2015 01:49
-
-
Save christopher-hopper/6052008 to your computer and use it in GitHub Desktop.
Generate a `.gitattributes` file
This file contains hidden or 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
# | |
# Find text files with this command | |
# | |
grep -r -m 1 "^" . \ | |
| grep -v "^Binary file" \ | |
| gawk 'BEGIN { FS=":" } { print $1 }' \ | |
| sed -re 's:.+\.([^\.]+)$:*.\1 text eol=lf:g' -e '/\//d' \ | |
| sort -u | |
# | |
# Find binary files with this command | |
# | |
grep -r -m 1 "^" . \ | |
| grep "^Binary file" \ | |
| sed -re 's:^Binary\sfile\s(.*)\smatches:\1:g' -e 's:.+\.([^\.]+)$:*.\1 binary:g' -e '/\//d' \ | |
| sort -u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment