Git AdvancedLesson 41Free preview
Git .gitattributes
This lesson is part of Git · All levels
Summary
The .gitattributes file sets Git behavior for specific file paths, such as line ending handling, binary markup, and custom merge drivers. Unlike .gitignore which ignores files, .gitattributes governs how Git treats files that remain tracked. These attributes help maintain consistent behavior between the operating system and team members.
Key points
- .gitattributes Set the behavior of Git per file path
- The text attribute eol=lf unifies the line ending to LF
- The binary attribute prevents Git from differing or merging files as text
- Custom driver merge can be defined by the merge attribute
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.