Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The end of your line-endings nightmare
Search
Alex Tercete
January 24, 2017
Programming
0
200
The end of your line-endings nightmare
See:
https://github.com/search?q=line+endings&type=Commits
Alex Tercete
January 24, 2017
Tweet
Share
More Decks by Alex Tercete
See All by Alex Tercete
Making Makefiles
alextercete
0
86
Shipping containers
alextercete
0
70
Parallelism and Symmetry
alextercete
0
250
Porting to .NET Standard
alextercete
0
74
Prepping Commits
alextercete
1
140
I love sushi, therefore I love rebase
alextercete
0
120
ReadyRoll for DotNet developers
alextercete
0
99
Coding Dojo: The Randori Kata
alextercete
1
570
How to be a good pair [programmer]
alextercete
0
140
Other Decks in Programming
See All in Programming
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
300
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
160
AtCoder Conference 2025
shindannin
0
610
AIコーディングエージェント(NotebookLM)
kondai24
0
230
ゆくKotlin くるRust
exoego
1
160
Patterns of Patterns
denyspoltorak
0
350
Basic Architectures
denyspoltorak
0
120
Cap'n Webについて
yusukebe
0
150
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
0
190
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 2
philipschwarz
PRO
0
120
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
140
Cell-Based Architecture
larchanjo
0
140
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.3k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
400
RailsConf 2023
tenderlove
30
1.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Agile that works and the tools we love
rasmusluckow
331
21k
Are puppies a ranking factor?
jonoalderson
0
2.4k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
38
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
210
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
170
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
70k
Transcript
Alex Tercete @alextercete The end of your line-endings nightmare CRLF
LF CRLF
CRLF CRLF CRLF CRLF LF LF LF LF
CRLF CRLF CRLF CRLF LF LF LF LF LF LF
CRLF CRLF
~/.gitconfig [core] autocrlf = true
None
CRLF CRLF CRLF CRLF Working directory Objects database LF LF
LF LF Commit core.autocrlf = true
CRLF CRLF CRLF CRLF Working directory Objects database LF LF
LF LF Checkout core.autocrlf = true
CRLF CRLF CRLF CRLF Working directory Objects database LF LF
LF LF Commit core.autocrlf = input
Working directory Objects database LF LF LF LF Checkout LF
LF LF LF core.autocrlf = input
Are we there yet?
No!
~/code/repo/.gitattributes * text=auto
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
$ echo "* text=auto" >.gitattributes $ rm .git/index $ git
reset $ git add -u $ git add .gitattributes $ git commit -m "Introduce end-of-line normalization"
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
Are we there yet?
NO! NO!
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
$ git checkout <branch> $ git rebase master -s recursive
-X renormalize
$ git init $ echo "* text=auto" >.gitattributes $ git
add .gitattributes $ git commit -m "Initial commit"
Are we there yet?
Yes!
Alex Tercete @alextercete Thanks! LF
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