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
180
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
64
Shipping containers
alextercete
0
52
Parallelism and Symmetry
alextercete
0
210
Porting to .NET Standard
alextercete
0
55
Prepping Commits
alextercete
1
120
I love sushi, therefore I love rebase
alextercete
0
100
ReadyRoll for DotNet developers
alextercete
0
85
Coding Dojo: The Randori Kata
alextercete
1
480
How to be a good pair [programmer]
alextercete
0
130
Other Decks in Programming
See All in Programming
Azure AI Foundryのご紹介
qt_luigi
1
210
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
1.4k
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
0
150
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
280
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.4k
Внедряем бюджетирование, или Как сделать хорошо?
lamodatech
0
950
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
『改訂新版 良いコード/悪いコードで学ぶ設計入門』活用方法−爆速でスキルアップする!効果的な学習アプローチ / effective-learning-of-good-code
minodriven
28
4.2k
良いユニットテストを書こう
mototakatsu
11
3.6k
ゼロからの、レトロゲームエンジンの作り方
tokujiros
3
1.1k
Scaling your build logic
antalmonori
1
100
自分ひとりから始められる生産性向上の取り組み #でぃーぷらすオオサカ
irof
3
370
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
Designing Experiences People Love
moore
139
23k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
19
2.3k
Rails Girls Zürich Keynote
gr2m
94
13k
RailsConf 2023
tenderlove
29
970
Typedesign – Prime Four
hannesfritz
40
2.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
210
Done Done
chrislema
182
16k
Scaling GitHub
holman
459
140k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
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