Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The end of your line-endings nightmare

The end of your line-endings nightmare

Alex Tercete

January 24, 2017
Tweet

More Decks by Alex Tercete

Other Decks in Programming

Transcript

  1. No!

  2. Objects database CRLF CRLF CRLF CRLF LF LF LF LF

    CRLF CRLF LF LF LF LF LF LF LF LF LF LF CRLF CRLF CRLF CRLF CRLF CRLF CRLF CRLF CRLF CRLF CRLF CRLF CRLF CRLF CRLF CRLF CRLF CRLF CRLF CRLF
  3. $ echo "* text=auto" >.gitattributes $ rm .git/index $ git

    reset $ git add -u $ git add .gitattributes $ git commit -m "Introduce end-of-line normalization"
  4. Objects database LF LF LF LF LF LF LF LF

    LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF
  5. Objects database LF LF LF LF LF LF LF LF

    LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF LF CRLF CRLF CRLF CRLF CRLF CRLF LF LF
  6. $ git init $ echo "* text=auto" >.gitattributes $ git

    add .gitattributes $ git commit -m "Initial commit"
  7. References Mind the End of Your Line http://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/ Dealing with

    line endings https://help.github.com/articles/dealing-with-line-endings/ gitattributes Documentation https://git-scm.com/docs/gitattributes