Skip to content

Instantly share code, notes, and snippets.

@dahoba
Created November 19, 2016 07:32
Show Gist options
  • Save dahoba/c6aeaa53695e1a30e6fbe2d7e402561a to your computer and use it in GitHub Desktop.
Save dahoba/c6aeaa53695e1a30e6fbe2d7e402561a to your computer and use it in GitHub Desktop.
Git attribute to deal with cross-platform line endings (Linux, macOS, Window)
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c eol=crlf
*.h eol=crlf
*.cpp eol=crlf
*.rc eol=crlf
*.vcproj eol=crlf
*.bat eol=crlf
# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.gif binary
*.ts text eol=lf
*.js text eol=lf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment