Last active
December 19, 2015 12:18
-
-
Save dhrrgn/5953539 to your computer and use it in GitHub Desktop.
Stop hoping that other's core.autocrlf is set correctly. Add this .gitattributes to the root of your repo. Add any specific files to ensure Git doesn't try anything funny on you. If you think i missed a common extension, let me know in the comments. See here for more details: http://timclem.wordpress.com/2012/03/01/mind-the-end-of-your-line/
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
# Ensures all line endings are committed as LF, but will checkout with native line endings | |
* text=auto | |
# -- Override Section, just in-case Git tries to be sneaky | |
# Ensure that these files are recognized as text | |
*.asp text | |
*.aspx text | |
*.asx text | |
*.c text | |
*.cfg text | |
*.coffee text | |
*.cpp text | |
*.css text | |
*.erb text | |
*.erl text | |
*.go text | |
*.groovy text | |
*.h text | |
*.hs text | |
*.html text | |
*.ini text | |
*.java text | |
*.js text | |
*.json text | |
*.jsp text | |
*.less text | |
*.md text | |
*.markdown text | |
*.php text | |
*.pl text | |
*.properties text | |
*.py text | |
*.rb text | |
*.rhtml text | |
*.rjs text | |
*.sass text | |
*.scala text | |
*.scss text | |
*.svg text | |
*.textile text | |
*.txt text | |
*.yml text | |
*.xml text | |
Makefile text | |
Procfile text | |
# Ensure that these binarys are, well, binary | |
*.bmp binary | |
*.bz2 binary | |
*.gif binary | |
*.jar binary | |
*.jpeg binary | |
*.jpg binary | |
*.png binary | |
*.tar.gz binary | |
*.zip binary |
Good call, not sure how I missed *.java. I also added *.scala, and *.coffee.
Added *.c, *.cpp and *.h for C/C++
Missing Makefile as text.
Thanks. Also added *.cfg. *.ini, *.json and *.yml
.pyc should be binary. Of course, ideally, one probably shouldn't be checking .pyc files into version control... but I'm sure people do.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice work!
Some more text extensions: *.java, *.groovy, *.properties *.gradle
More binary extensions: *.tar.gz, *.tgz, *.bz2, *.jar