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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Alex Tercete
January 24, 2017
Programming
210
0
Share
The end of your line-endings nightmare
See:
https://github.com/search?q=line+endings&type=Commits
Alex Tercete
January 24, 2017
More Decks by Alex Tercete
See All by Alex Tercete
Making Makefiles
alextercete
0
95
Shipping containers
alextercete
0
77
Parallelism and Symmetry
alextercete
0
260
Porting to .NET Standard
alextercete
0
82
Prepping Commits
alextercete
1
160
I love sushi, therefore I love rebase
alextercete
0
120
ReadyRoll for DotNet developers
alextercete
0
110
Coding Dojo: The Randori Kata
alextercete
1
580
How to be a good pair [programmer]
alextercete
0
150
Other Decks in Programming
See All in Programming
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
140
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
180
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
0
190
色即是空、空即是色、データサイエンス
kamoneggi
1
110
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
150
横断組織出身のQAEがインプロセスQAEでつまずいたこと・活かせたこと
ty89
0
110
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
450
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
150
サークル参加から学ぶ、小さな事業の回し方
yuzneri
0
200
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
120
SkillsをS3 Filesに置く時のあれこれ
watany
3
1.6k
リセットCSSを1行消したらアクセシビリティが向上した話
pvcresin
4
520
Featured
See All Featured
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
340
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
460
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
55k
Code Reviewing Like a Champion
maltzj
528
40k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
440
The Art of Programming - Codeland 2020
erikaheidi
57
14k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
54
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
230
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
530
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
The World Runs on Bad Software
bkeepers
PRO
72
12k
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