Skip to content

Instantly share code, notes, and snippets.

@DavidBruchmann
Forked from dpalomar/.gitattributes
Last active January 26, 2022 10:26
Show Gist options
  • Save DavidBruchmann/c320df1fa38e548bd2184a4259f6c25a to your computer and use it in GitHub Desktop.
Save DavidBruchmann/c320df1fa38e548bd2184a4259f6c25a to your computer and use it in GitHub Desktop.
Fixing CRLF with gitattributes
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto
# Force the following filetypes to have unix eols, so Windows does not break them
*.* text eol=lf
# Windows forced line-endings
/.idea/* text eol=crlf
#
## Binary files should be left untouched
#
# (binary is a macro for -text -diff)
# images
*.ai binary
*.apng binary
*.avif binary
*.cur binary
*.gif binary
*.ico binary
*.jpg binary
*.jpeg binary
*.png binary
*.psd binary
*.webp binary
*.svgz binary
# media:
*.mov binary
*.mp4 binary
*.mp3 binary
*.wav binary
*.avi binary
# outdated flash:
*.flv binary
*.fla binary
*.swf binary
# archives (https://en.wikipedia.org/wiki/List_of_archive_formats):
*.7z binary
*.bz2 binary
*.gz binary
*.lz binary
*.lz4 binary
*.lzma binary
*.lzo binary
*.rar binary
*.rz binary
*.sfark binary
*.sz binary
*.tar binary
*.tgz binary
*.xz binary
*.z binary
*.zst binary
*.zip binary
# font-files:files
*.ttf binary
*.eot binary
*.woff binary
*.woff2 binary
*.otf binary
# misc.:
*.pyc binary
*.pdf binary
*.ez binary
*.swp binary
*.sqlite
# OPTIONAL: add office documents:
*.docx binary
*.doc binary
*.xlsx binary
*.xls binary
*.odb binary
*.odf binary
*.odg binary
*.odp binary
*.ods binary
*.odt binary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment