Enforce LF newlines

This change is done in order to ensure that Windows users don't
encounter any newline related issues.

e.g.: Prior to this change, after the build script was run, files
from `node_modules` (having `LF` newlines, and which wouldn't have
be normalized by `git`) would be copied to the `dist/` directory
and would appear to Windows users as if they where changed.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Thanks to @XhmikosR for pointing this out!

Ref http://git-scm.com/docs/gitattributes#_effects
    http://en.wikipedia.org/wiki/Newline

Close h5bp/html5-boilerplate#1618
This commit is contained in:
Cătălin Mariș
2014-10-15 15:50:01 +03:00
parent 697fa65431
commit 6f50688c1c
3 changed files with 20 additions and 1 deletions

15
.gitattributes vendored
View File

@@ -1 +1,16 @@
# Automatically normalize line endings for all text-based files
# http://git-scm.com/docs/gitattributes#_effects
* text=auto
# For the following file types, normalize line endings to LF on
# checkin and prevent conversion to CRLF when they are checked out
# (this is required in order to prevent newline related issues like,
# for example, after the build script is run)
*.css text eol=lf
*.html text eol=lf
*.js text eol=lf
*.json text eol=lf
*.md text eol=lf
*.sh text eol=lf
*.txt text eol=lf
*.xml text eol=lf