Przejdź do treści

⚙️ .gitattributes

.gitattributes controls how Git handles files: diffing, merging, line endings, and binary detection.


🎓 Who This Is For

  • Beginners learning repository configuration
  • Intermediate users improving collaboration workflows
  • Advanced engineers needing structured reference
  • DevOps and developers working with multi-language repos

🔧 Common Use Cases

  • Enforcing LF/CRLF
  • Marking binary files
  • Custom diff drivers
  • Language-specific merge strategies

🧩 Examples

Enforce LF

1
* text=auto eol=lf

Mark binary files

1
2
*.png binary
*.jpg binary

Better diffs for languages

1
2
*.cs diff=csharp
*.js diff=javascript