Reputation: 16267
From: http://git-scm.com/docs/gitattributes#_using_attribute_macros
End-of-line conversion
While Git normally leaves file contents alone, it can be configured to normalize line endings to LF in the repository and, optionally, to convert them to CRLF when files are checked out.
Here is an example that will make Git normalize .txt, .vcproj and .sh files, ensure that .vcproj files have CRLF and .sh files have LF in the working directory, and prevent .jpg files from being normalized regardless of their content.
*.txt text *.vcproj eol=crlf *.sh eol=lf *.jpg -text
What is the difference between:
* text
* eol=crlf
I my repo I have tried to add:
*.txt text
*.sample eol=crlf
But it gives the same (Both have CRLF line endings) so are those attributes equivalent?
Upvotes: 1
Views: 389
Reputation: 78643
No. These produce the same output if and only if your platform uses CR/LF natively.
The text
instruction tells Git to use whatever line endings are standard for your platform.
If you checked these files out on a Unix system (which uses LF only) then your .sample
files would be checked out with CR/LF line endings, and your .txt
files would be checked out with LF line endings.
Upvotes: 3