Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
My standard .gitattribute file that I like to add to my Git repos and projects
# Brad adding this file to deal with issues of Windows and Linux line endings
# on the project basis.
# *********************************************************
# * NO ONE BUT BRAD SHOULD EDIT THIS FILE!
# *********************************************************
# @create: 5/13/2017
# @modified: 9/21/2019
# Details per file setting:
# text These files should be normalized (i.e. convert CRLF to LF).
# binary These files are binary and should be left untouched.
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Git Files - convert to LF line endings
## CONFIGS
*.bowerrc text eol=lf
*.cnf text eol=lf
*.conf text eol=lf
*.config text eol=lf
.editorconfig text eol=lf
.gitattributes text eol=lf
.gitconfig text eol=lf
.gitignore text eol=lf
.htaccess text eol=lf
*.npmignore text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
Makefile text eol=lf
makefile text eol=lf
## DOCUMENTATION
*.markdown text eol=lf
*.md text eol=lf
*.mdwn text eol=lf
*.mdown text eol=lf
*.mkd text eol=lf
*.mkdn text eol=lf
*.mdtxt text eol=lf
*.mdtext text eol=lf
*.txt text eol=lf
AUTHORS text eol=lf
CHANGELOG text eol=lf
CHANGES text eol=lf
CONTRIBUTING text eol=lf
COPYING text eol=lf
copyright text eol=lf
*COPYRIGHT* text eol=lf
INSTALL text eol=lf
license text eol=lf
LICENSE text eol=lf
NEWS text eol=lf
readme text eol=lf
*README* text eol=lf
TODO text eol=lf
# Explicitly declare text eol=lf files you want to always be normalized and converted
# to native line endings on checkout.
*.c text eol=lf
*.h text eol=lf
*.php text eol=lf
*.js text eol=lf
*.css text eol=lf
*.java text eol=lf
*.txt text eol=lf
*.json text eol=lf
*.xml text eol=lf
*.XML text eol=lf
*.html text eol=lf
*.htm text eol=lf
*.sql text eol=lf
*.csv text eol=lf
*.less text eol=lf
*.scss text eol=lf
*.ini text eol=lf
*.coffee text eol=lf
*.jsx text eol=lf
*.pl text eol=lf
*.py text eol=lf
*.rb text eol=lf
*.sass text eol=lf
*.scm text eol=lf
*.sh text eol=lf
*.styl text eol=lf
*.ts text eol=lf
*.xhtml text eol=lf
## TEMPLATES
*.dot text eol=lf
*.ejs text eol=lf
*.haml text eol=lf
*.handlebars text eol=lf
*.hbs text eol=lf
*.hbt text eol=lf
*.jade text eol=lf
*.latte text eol=lf
*.mustache text eol=lf
*.njk text eol=lf
*.phtml text eol=lf
*.tmpl text eol=lf
*.tpl text eol=lf
*.twig text eol=lf
## Document / Word Files - Convert to text eol=lf first then do a diff
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
## DOCKER
*.dockerignore text eol=lf
Dockerfile text eol=lf
# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=lf eol=crlf
*.bat text eol=lf eol=crlf
*.csproj text eol=lf merge=union
# BINARY Section - Denote all files that are truly binary and should not be modified.
## Image Files
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text eol=lf
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary
## Web Fonts
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.woff2 binary
## Balsamiq Mockup Files
*.bpmr binary
## MySQL Workbench Files
*.mwb binary
*.bak binary
## Excel Files
*.xls binary
*.xlsx binary
## Python - Binary files
*.db binary
*.p binary
*.pkl binary
*.pyc binary
*.pyd binary
*.pyo binary
## ARCHIVES
*.7z binary
*.gz binary
*.rar binary
*.tar binary
*.zip binary
*.z binary
## VIDEO
*.3gpp binary
*.3gp binary
*.as binary
*.asf binary
*.asx binary
*.fla binary
*.flv binary
*.m4v binary
*.mng binary
*.mov binary
*.mp4 binary
*.mpeg binary
*.mpg binary
*.swc binary
*.swf binary
*.webm binary
## AUDIO
*.kar binary
*.m4a binary
*.mid binary
*.midi binary
*.mp3 binary
*.ogg binary
*.ra binary
# JAVA Binaries These files are binary and should be left untouched
# (binary is a macro for -text eol=lf -diff)
*.class binary
*.dll binary
*.ear binary
*.gif binary
*.ico binary
*.jar binary
*.jpg binary
*.jpeg binary
*.png binary
*.so binary
*.war binary
db/dumps/*.sql filter=lfs diff=lfs merge=lfs -text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment