In certain circumstances, Git will munge line endings when it checks out
and commits files. This can result in difficult-to-debug errors when
files are changed when they're checked out. To avoid that problem, set
.gitattributes such that Git will always use LF line endings for files
it detects as text files.
*.diff and *.patch files are excluded, as committed patch files may need
to patch upstream source code that intentionally uses CRLF line endings.
Fixes#423762
This adds the .gitattributes file to the tree. I’ve added two
attributes: linguist-generated, and linguist-documentation.
GitHub’s Linguist will follow this when calculating our language stats
as well as in other cases like commit diffs.
Any additional attributes or other generated files are welcome to be added!