What Is a .gitattributes file?
a .gitattributes file explained, including what it does and how it matters in CI/CD.
A .gitattributes file tells Git how to handle specific paths: line endings, diff/merge behavior, and LFS tracking.
What it is
Setting * text=auto and explicit eol rules normalizes line endings so the same content checks out consistently across operating systems.
Why it matters in CI/CD
In CI, this prevents CRLF-related failures (shell scripts with \r) on Linux runners and controls which files use Git LFS.
Key takeaways
- .gitattributes controls per-path Git behavior.
- It normalizes line endings.
- Prevents CRLF failures in CI.
Related guides
What Is an .editorconfig file?The .editorconfig file standardizes editor settings across a team. Learn its role.
What Is Git LFS?What is Git LFS? Learn how Large File Storage keeps big binaries out of Git history with pointers, why it spe…
What Is Git?What is Git? A plain-English explainer of the distributed version control system that tracks code history, en…