What is a `.gitattributes` file used for?
BeginnerConceptCommits, branches and tags
Answer
It sets per-path behaviour: line-ending normalisation (text=auto eol=lf), binary markers, custom diff and merge drivers, LFS filters, and export-ignore for git archive. Committing it makes behaviour consistent for the whole team.
* text=auto eol=lf
*.png binary
*.psd filter=lfs diff=lfs merge=lfs -text
More on Commits, branches and tags
How do you write a good commit message?BeginnerWhat is the difference between `git add .`, `git add -A` and `git add -u`?BeginnerHow do you commit only part of the changes in a file?BeginnerHow do you change the last commit message or add a forgotten file?BeginnerWhat is the difference between `git switch`, `git restore` and `git checkout`?BeginnerWhat is the difference between lightweight and annotated tags?Beginner