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
160
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
57
Shipping containers
alextercete
0
50
Parallelism and Symmetry
alextercete
0
170
Porting to .NET Standard
alextercete
0
53
Prepping Commits
alextercete
1
120
I love sushi, therefore I love rebase
alextercete
0
99
ReadyRoll for DotNet developers
alextercete
0
84
Coding Dojo: The Randori Kata
alextercete
1
400
How to be a good pair [programmer]
alextercete
0
110
Other Decks in Programming
See All in Programming
ServerAction で Progressive Enhancement はどこまで頑張れるか? / progressive-enhancement-with-server-action
takefumiyoshii
6
410
雑に思考を整理する技術と効能
konifar
63
30k
Sheets API使ってみた
toshi0383
2
160
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
220
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
120
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
27
8.5k
Ruby Pattern Matching
bkuhlmann
0
930
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
900
"config" ってなんだ? / What is "config"?
okashoi
0
250
What We Can Learn From OSS
inouehi
0
430
Ruby GitHub Packages
bkuhlmann
0
640
Site Reliability Engineering for GMO
pyama86
8
1.1k
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
331
56k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
46k
Making the Leap to Tech Lead
cromwellryan
125
8.5k
Creatively Recalculating Your Daily Design Routine
revolveconf
211
11k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
126
32k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
65
14k
Building Your Own Lightsaber
phodgson
100
5.7k
Embracing the Ebb and Flow
colly
80
4.2k
It's Worth the Effort
3n
180
27k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
19
6.9k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
8
1.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
33
6k
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