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
390
How to be a good pair [programmer]
alextercete
0
110
Other Decks in Programming
See All in Programming
Compiling Python to WebAssembly with py2wasm
syrusakbary
0
130
【KMC春合宿2024】実装視点で見るNeural Radiance Fields
runningoutrate
0
150
ONE WEDGE_Company_Information
1wedge
0
170
Crafting a Own PHP - ウキウキ手作りミニマリストPHP
uzulla
4
1.1k
コミュニティに参加したことで起きた変化
ohmori_yusuke
3
130
上手な探索的テストとその上達方法について
matsu802
4
650
Building a Smaller App Binary
kateinoigakukun
2
200
LPIXEL×CADDi_kaerururu
kaerururu
3
300
BuefyのMaintainerを引き継いだ件
kikuomax
0
520
孤独のCTOグルメという やや奇抜な企画をやった目的と効果
shoheimitani
3
1k
どうしてこうなった命名集 ~🔥編~ / OOC 2024 LT
pictiny
4
2.8k
TCAの Shared Stateって どういう仕組みになってんの?
yimajo
0
330
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.8k
From Idea to $5000 a Month in 5 Months
shpigford
376
45k
How GitHub Uses GitHub to Build GitHub
holman
467
290k
Making the Leap to Tech Lead
cromwellryan
123
8.4k
A Philosophy of Restraint
colly
195
15k
Music & Morning Musume
bryan
39
5.5k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
185
15k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
657
120k
What the flash - Photography Introduction
edds
64
11k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
28
5.9k
The Cost Of JavaScript in 2023
addyosmani
13
3.7k
YesSQL, Process and Tooling at Scale
rocio
160
13k
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