Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
89
Shipping containers
alextercete
0
71
Parallelism and Symmetry
alextercete
0
250
Porting to .NET Standard
alextercete
0
77
Prepping Commits
alextercete
1
150
I love sushi, therefore I love rebase
alextercete
0
120
ReadyRoll for DotNet developers
alextercete
0
100
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
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
490
CSC307 Lecture 09
javiergs
PRO
1
850
AIプロダクト時代のQAエンジニアに求められること
imtnd
1
500
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.1k
株式会社 Sun terras カンパニーデック
sunterras
0
1.9k
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
12
5.8k
nilとは何か 〜interfaceの構造とnil!=nilから理解する〜 / Understanding nil in Go Interface Representation and Why nil != nil
kuro_kurorrr
3
1.5k
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
900
浮動小数の比較について
kishikawakatsumi
0
360
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
390
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
100
CSC307 Lecture 14
javiergs
PRO
0
440
Featured
See All Featured
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
850
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
610
Visualization
eitanlees
150
17k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4k
Automating Front-end Workflow
addyosmani
1371
200k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
130
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.1k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.4k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
140
Paper Plane
katiecoart
PRO
0
47k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
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