Git - End Of Line

About

This page is talking about the EOL characters management in git.

.gitattributes

In the .gitattributes file

  • One file
path/to/my/file eol=crlf
  • All files with .txt extension
*.txt -crlf
  • exclusion
!*.xyz 
  • If you want files you check in to be normalized
* text=auto
* text=auto eol=lf

Management

Default

  • All repo
git config --global core.eol lf
  • Current repo
git config core.eol crlf

After default modification, delete the stagin area

git rm --cached -rf .

Disable Conversion

git config --global core.autocrlf false

Powered by ComboStrap