Skip to main content

.gitattributes Builder

v1.0.3

Generate .gitattributes policies for line endings and binary files.

Generates .gitattributes files with line ending policies (lf/crlf) for different file types and binary file markers — ensuring consistent line endings across Windows and Unix development environments.

How to use
  • Select your primary OS and language stack for auto-generated defaults.
  • Add file type entries and their line ending strategy individually.
  • Copy to .gitattributes at your project root; run git add --renormalize . after adding.
.gitattributes
# .gitattributes — generated by gitattributes-gen

# Default line endings
* text=auto eol=lf

# Source files
*.js text eol=lf
*.ts text eol=lf
*.jsx text eol=lf
*.tsx text eol=lf
*.json text eol=lf
*.md text eol=lf
package-lock.json -diff

# Binary assets
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.svg binary
*.pdf binary
*.zip binary
*.wasm binary

# Lock files — do not diff
package-lock.json merge=ours
yarn.lock merge=ours
pnpm-lock.yaml merge=ours