.gitattributes to control the line endings for files that are in the repository.
The above settings are useful when working with others who use other Operating Systems, because each OS has its own line endings for files.
When determining which settings to apply, Git gives higher precedence to the
- Every text file is checked out with
LFline endings in the working directory (
- Every potentially introduced
CRLFin a text file will be converted back to
LFon staging (
Git documentation describes the “Formatting and Whitespace” options available when installing it. But I’m not going to check each everyone’s git installation to confirm that they’ve set these up as I’d like
After coming across these settings in a spectral’s commit, I decided to use them too and add them to my git utilities.