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
88
Shipping containers
alextercete
0
70
Parallelism and Symmetry
alextercete
0
250
Porting to .NET Standard
alextercete
0
76
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
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
120
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
200
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
280
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
480
Data-Centric Kaggle
isax1015
2
780
組織で育むオブザーバビリティ
ryota_hnk
0
180
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
150
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.7k
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
180
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
150
React Native × React Router v7 API通信の共通化で考えるべきこと
suguruooki
0
100
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
230
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
200
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
310
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
340
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
170
Crafting Experiences
bethany
1
54
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
3.9k
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