gitattributes
The git attributes file maps file extensions to content types. This way, for example, it is possible telling git that the xml extension is used only for text files and never for binaries.
Actually it is more like a set of hints than a configuration file, and can make it easier working with several formats.
The previous example is mapping several extensions as text files. But it is also telling how to inspect changes, and which end of line character should be used.
This is saying that changes in CSS files should be inspected using CSS rules:
This is setting up the end of line conversion for Javascript files to CRLF:
It can contain global configuration too.
This defaults all files to text files, and normalizes line endings:
Line endings
Line endings can give lots of problems when working in a team. Always normalize them.
Last updated
Was this helpful?