SlideShare a Scribd company logo
Tracking huge files with
Git LFS
LARS SCHNEIDER • GIT SOLUTIONS LEAD • AUTODESK • @KIT3BUS
STEVE SMITH • DEVOPS ADVOCATE • ATLASSIAN • @TARKASTEVE
THE GIT LFS MODEL
THE PROBLEM WITH BIG FILES
Agenda
MIGRATION
GIT LFS PERSONAS
THE GIT DATA MODEL
data model
$> git init
$> tree .git/objects
.git/objects
── info
└── pack
2 directories
$> touch some-file.txt
$> git add some-file.txt
$> tree .git/objects
.git/objects
── e6
│   └── 9de29bb2d1d6434b8b29ae775ad8c2e48c5391
── info
└── pack
3 directories, 1 file
zlib compressed
SHA1
Type Chapter title here
master
98ca9..
bab1e..
fad3d..
cat .git/refs/heads/master$
fad3dd41d0cf3d1b6aa2d8ad0549ab2fcb1575d1
“Directed Acyclic Graph”
master
98ca9..
bab1e..
fad3d..
434bb..tree
bab1e..parent
Tim P <kannonboy@…> 1455209277 -0800committer
Tim P <kannonboy@…> 1455209277 -0800author
My life is my commit message.
git cat-file -p 98ca9$
git cat-file -p 434bb
ace23..100644 blob .gitignore
dbdbd..100644 blob README.md
a0bc3..040000 tree app
33d33..040000 tree config
b1de7..100755 blob deploy-prod.sh
7011e..100755 blob deploy-staging.sh
typefilemode SHA-1
master
98ca9..
bab1e..
fad3d..
$
434bb..
master
98ca9..
bab1e..
fad3d..
434bb..
master
98ca9..
bab1e..
fad3d..
434bb..
98ca9..
bab1e..
fad3d..
master
98ca9..
bab1e..
fad3d..
master
98ca9..
bab1e..
fad3d..
master
50mb
100mb
150mb
98ca9..
bab1e..
fad3d..
master
Tracking Huge Files with Git LFS
(Large File Storage)
Git LFS
dabad..
98ca9..
bab1e..
fad3d..
86753..
434bb..
$
LFS store
Git host
☞
☞
☞
Git host
LFS store
$
dabad..
98ca9..
bab1e..
fad3d..
86753..
434bb..
LFS store
git push$
☞
☞
☞
dabad..
98ca9..
bab1e..
fad3d..
86753..
434bb..
Git host
git pull$
LFS store
Git host
☞
☞
☞
dabad..
98ca9..
bab1e..
fad3d..
86753..
434bb..
4749d..
bdd12..
778aa..
git checkout bab1e$
LFS store
Git host
☞
☞
☞
dabad..
98ca9..
bab1e..
fad3d..
86753..
434bb..
4749d..
bdd12..
778aa..
HEAD
https://git-lfs.github.com/spec/v1version
sha256:325ddfb…oid
29342295size
git cat-file -p 4749d$
☞
☞
☞
dabad..
98ca9..
bab1e..
fad3d..
86753..
434bb..
4749d..
bdd12..
778aa..
massive_video.mp4
Work tree
dev
.git/lfs/objects
Clean filter
(git-lfs clean)
☞
Index
massive_video.mp4
$
.git/objects
git add
$
dev
.git/lfs/objects
Smudge filter
(git-lfs smudge)
Work tree
massive_video.mp4
☞
Commit tree
massive_video.mp4
.git/objects
LFS Store
git checkout
.git/lfs/objects
.git/objects
Hosted repo
LFS store
git push / pull
$ brew install git-lfs
$ git lfs install
$ cat ~/.gitconfig
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
$ git lfs track “*.mp4”
$ cat .gitattributes
*.mp4 filter=lfs diff=lfs merge=lfs -text
@kit3bus
Lars Schneider
Autodesk Inc.
Git and Git LFS
contributor
Technical Lead for

Git at Autodesk
@kit3bus
Who are we?
• Best known for AutoCAD

2D and 3D computer-aided design

• 33 years in business

• 4000 engineers, hundreds of
products, terabytes of code and
asset data
@kit3bus
Architecture,
Engineering and
Construction
Image by Dave Tyner, Autodesk Plant 3D - P&ID
@kit3bus
Manufacturing
@kit3bus
Media and
Entertainment
@kit3bus
3D Printing



"Future of
Making Things"
Image courtesy of Local Motors Inc.
@kit3bus
What do we use
Git LFS
for?
Integration Test Data

(3D Models, ...)
Auxiliary Data

(Documentation, Images,
Videos, ...)
Build Artifacts

(not recommended)
@kit3bus
DEVELOPER
MIGRATOR
ADMINISTRATOR
- Git LFS Usage -
What have we learned?
@kit3bus
Migrator
@kit3bus
Migration
Process
1
Identify an engineer with
deep code knowledge
Create a "demo" migration
on Git migration server
Iterate on "demo" migration
until repo and CI are OK
Ask broader team to "play"
with the "demo" migration
Perform migration on Git
production server
2
3
4
5
@kit3bus
How to
migrate?
@kit3bus
How to
migrate?
git-svn / git-p4 / git-tfs ...
@kit3bus
How to
migrate?
+
git-svn / git-p4 / git-tfs ...
git filter branch / git-lfs-migrate
@kit3bus
How to
migrate?
+
git-p4
git-svn / git-p4 / git-tfs ...
git filter branch / git-lfs-migrate
@kit3bus
Git LFS

Migration
Gotchas
Discard large file
history
1998 2007 2016
code code code
+++
@kit3bus
Git LFS

Migration
Gotchas
Avoid "orphaned"
LFS files after
history rewrite
LFS

Ptr
Git Repo LFS Storage
@kit3bus
(INCLUDES DESIGNER, TESTER, ...)
Developer
@kit3bus
Teach why
"Large" files
are a problem!
All history is local.
Good for source files.
Problem for large files.
@kit3bus
What is a
"problematic"
file?
Files that do not
compress well...
@kit3bus
What is a
"problematic"
file?
... and change
frequently.
Mon Tue Wed
@kit3bus
What is a
"problematic"
file?
Files smaller than
500kb are OK.
Rule of
Thumb
@kit3bus
How to track
Git LFS files?
git lfs track "*.png"
@kit3bus
How to track
Git LFS files?
git lfs track "*.png"
@kit3bus
How to track
Git LFS files?
git lfs track "*.lfs.*"
e.g. /images/elephant.lfs.png
@kit3bus
How to track
Git LFS files?
git lfs track "/big/*"
e.g. /big/elephant.png
@kit3bus
How to track
Git LFS files?
git lfs track "/xxl.png"
@kit3bus
How to track
Git LFS files?
Less than 1000
files in LFS are OK.
Rule of
Thumb
Up to 70x speed improvement
pending!
@kit3bus
git lfs track "*.png"
git lfs track "*.[pP][nN][gG]"
Case sensitive:
Case in-sensitive:
Git LFS

Gotchas
@kit3bus
No line ending
conversions on
LFS files!
Git LFS 

Gotchas
@kit3bus
Use the latest

Git / Git LFS
version!
Git LFS 

Tips & Tricks
@kit3bus
Setup your Git
credential helper 

(or use SSH)!



Watch out for the
"administrator" shell!
Git LFS 

Tips & Tricks
@kit3bus
git lfs clone <URL>
Use Git 2.9+ if your Submodules
contain Git LFS files.
Git LFS 

Tips & Tricks
@kit3bus
Git LFS 

Tips & Tricks
Use Git Sparse Checkout if
you have too many LFS files!
@kit3bus
Administrator
@kit3bus
How to make
sure Git LFS is
used properly?
Configure Git LFS
on all platforms!
Enterprise Config for Git

https://git.io/vi1F4
@kit3bus
How to make
sure Git LFS is
used properly?
"What happens in
Git, stays in Git."
@kit3bus
How to make
sure Git LFS is
used properly?
Rewriting history
can cause a lot of
trouble!
@kit3bus
How to make
sure Git LFS is
used properly?
Configure file size
limit on Git server!
@kit3bus
How to make
sure Git LFS is
used properly?
Configure file size
limit with local

Git pre-commit
hooks!
@kit3bus
How to make
sure Git LFS is
used properly?
Use code reviews
and limit write
access to shared
branches!



At least initially.
@kit3bus
Takeaways
• Git LFS works
• Use the latest Git/Git LFS version
• Use `git lfs clone`
• Track problematic files in Git LFS
• Reject problematic files in Git
• Keep an eye on # of tracked files

More Related Content

PPTX
コンテナネットワーキング(CNI)最前線
PPTX
Kubernetes環境に対する性能試験(Kubernetes Novice Tokyo #2 発表資料)
PDF
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発
PPTX
CNIふぉーびぎなーず
PPT
PDF
Internet of things applications covering industrial domain
PDF
分散ストレージソフトウェアCeph・アーキテクチャー概要
コンテナネットワーキング(CNI)最前線
Kubernetes環境に対する性能試験(Kubernetes Novice Tokyo #2 発表資料)
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発
CNIふぉーびぎなーず
Internet of things applications covering industrial domain
分散ストレージソフトウェアCeph・アーキテクチャー概要

What's hot (20)

PDF
Docker道場オンライン#1 Docker基礎概念と用語の理解
ODP
DRBD/Heartbeat/Pacemakerで作るKVM仮想化クラスタ
PDF
CentOS 8で標準搭載! 「389-ds」で構築する 認証サーバーについて
PDF
Git slides
PDF
いつやるの?Git入門 v1.1.0
PDF
AWS 初心者向けWebinar 基本から理解する、AWS運用監視
PDF
WordPressのCDN化
PDF
これからLDAPを始めるなら 「389-ds」を使ってみよう
PDF
Git and Github slides.pdf
PDF
Dockerからcontainerdへの移行
PDF
20200708サーバーレスでのAPI管理の考え方
PDF
リアクティブプログラミングとMVVMパターンについて
PDF
JS7 JobScheduler プレビュー
PPTX
Spring Fest 2017 「エンタープライズで利用するSpring Boot」#jsug #sf_h1
PDF
kube-system落としてみました
PDF
hbstudy# 28 SELinux HandsOn 公開版
PDF
Node-REDでプロジェクト管理を始めてみよう!
PDF
ヘッドレスCMS調査 Strapiを試してみた
PDF
入社1年目のプログラミング初心者がSpringを学ぶための手引き
Docker道場オンライン#1 Docker基礎概念と用語の理解
DRBD/Heartbeat/Pacemakerで作るKVM仮想化クラスタ
CentOS 8で標準搭載! 「389-ds」で構築する 認証サーバーについて
Git slides
いつやるの?Git入門 v1.1.0
AWS 初心者向けWebinar 基本から理解する、AWS運用監視
WordPressのCDN化
これからLDAPを始めるなら 「389-ds」を使ってみよう
Git and Github slides.pdf
Dockerからcontainerdへの移行
20200708サーバーレスでのAPI管理の考え方
リアクティブプログラミングとMVVMパターンについて
JS7 JobScheduler プレビュー
Spring Fest 2017 「エンタープライズで利用するSpring Boot」#jsug #sf_h1
kube-system落としてみました
hbstudy# 28 SELinux HandsOn 公開版
Node-REDでプロジェクト管理を始めてみよう!
ヘッドレスCMS調査 Strapiを試してみた
入社1年目のプログラミング初心者がSpringを学ぶための手引き
Ad

Viewers also liked (20)

PDF
Verifying Microservice Integrations with Contract Testing
PDF
Takeaways From Migrating to Git and Bitbucket Server
PDF
Bitbucket Pipelines: Serverless CI/CD That Will Save Your Life
PDF
Releasing the Monolith On a Daily Basis
PDF
Scaling Your First 1000 Containers with Docker
PDF
Popular Git Workflows You Haven't Heard About
PDF
Continuous Delivery in the Cloud with Bitbucket Pipelines
PDF
Scaling Without Expanding: a DevOps Story
PDF
Mock Servers - Fake All the Things!
PDF
Git 더하기 GitHub(구름IDE 환경)
PDF
Code reviews vs Pull requests
PDF
Give the Power Back: Unleashing Creativity, Drive, and Innovation
PDF
Designing Teams - How Building a Great Workspace is Like Building Great Software
PDF
Fast then Faster - a Retrospective on Retrospectives
PDF
Practiced Curiosity: Building Collaboration Between Development and Design
PDF
Mechanisms of Delight: HipChat Bots for the Masses
PDF
Marketing: Your Unexpected DevOps Allies
PDF
'Xero-ing in' on Global Collaboration During Hyper-Growth
PDF
DevTools at Netflix: Culture, Speed & Innovation
PDF
Diversity Matters: How to Be the Change you Seek
Verifying Microservice Integrations with Contract Testing
Takeaways From Migrating to Git and Bitbucket Server
Bitbucket Pipelines: Serverless CI/CD That Will Save Your Life
Releasing the Monolith On a Daily Basis
Scaling Your First 1000 Containers with Docker
Popular Git Workflows You Haven't Heard About
Continuous Delivery in the Cloud with Bitbucket Pipelines
Scaling Without Expanding: a DevOps Story
Mock Servers - Fake All the Things!
Git 더하기 GitHub(구름IDE 환경)
Code reviews vs Pull requests
Give the Power Back: Unleashing Creativity, Drive, and Innovation
Designing Teams - How Building a Great Workspace is Like Building Great Software
Fast then Faster - a Retrospective on Retrospectives
Practiced Curiosity: Building Collaboration Between Development and Design
Mechanisms of Delight: HipChat Bots for the Masses
Marketing: Your Unexpected DevOps Allies
'Xero-ing in' on Global Collaboration During Hyper-Growth
DevTools at Netflix: Culture, Speed & Innovation
Diversity Matters: How to Be the Change you Seek
Ad

Similar to Tracking Huge Files with Git LFS (20)

DOCX
What is Git LFS (Large File Storage): An Overview
PDF
Tracking large game assets with Git LFS
PDF
Tracking huge files with Git LFS (GlueCon 2016)
PDF
Optimizing Git LFS Migration Through Repository Data-mining
PDF
How to store large binary files in git repositories
PDF
Git (FS and DVCS)
PDF
Tracking huge files with Git LFS - LinuxCon 2016
PPTX
MakingGitWorkForYou
PDF
Git essentials
PDF
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
PDF
Loading...git
PDF
Git best practices workshop
PDF
Jedi Mind Tricks in Git
PPTX
Git One Day Training Notes
PDF
Open Source Tools for Leveling Up Operations FOSSET 2014
PDF
Getting Git Right
PDF
M.Mozūras - git
KEY
Git Magic: Versioning Files like a Boss
PDF
Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
PPTX
Practical Git - NYC Code Camp
What is Git LFS (Large File Storage): An Overview
Tracking large game assets with Git LFS
Tracking huge files with Git LFS (GlueCon 2016)
Optimizing Git LFS Migration Through Repository Data-mining
How to store large binary files in git repositories
Git (FS and DVCS)
Tracking huge files with Git LFS - LinuxCon 2016
MakingGitWorkForYou
Git essentials
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Loading...git
Git best practices workshop
Jedi Mind Tricks in Git
Git One Day Training Notes
Open Source Tools for Leveling Up Operations FOSSET 2014
Getting Git Right
M.Mozūras - git
Git Magic: Versioning Files like a Boss
Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
Practical Git - NYC Code Camp

More from Atlassian (20)

PPTX
International Women's Day 2020
PDF
10 emerging trends that will unbreak your workplace in 2020
PDF
Forge App Showcase
PDF
Let's Build an Editor Macro with Forge UI
PDF
Meet the Forge Runtime
PDF
Forge UI: A New Way to Customize the Atlassian User Experience
PDF
Take Action with Forge Triggers
PDF
Observability and Troubleshooting in Forge
PDF
Trusted by Default: The Forge Security & Privacy Model
PDF
Designing Forge UI: A Story of Designing an App UI System
PDF
Forge: Under the Hood
PDF
Access to User Activities - Activity Platform APIs
PDF
Design Your Next App with the Atlassian Vendor Sketch Plugin
PDF
Tear Up Your Roadmap and Get Out of the Building
PDF
Nailing Measurement: a Framework for Measuring Metrics that Matter
PDF
Building Apps With Color Blind Users in Mind
PDF
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
PDF
Beyond Diversity: A Guide to Building Balanced Teams
PDF
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
PDF
Building Apps With Enterprise in Mind
International Women's Day 2020
10 emerging trends that will unbreak your workplace in 2020
Forge App Showcase
Let's Build an Editor Macro with Forge UI
Meet the Forge Runtime
Forge UI: A New Way to Customize the Atlassian User Experience
Take Action with Forge Triggers
Observability and Troubleshooting in Forge
Trusted by Default: The Forge Security & Privacy Model
Designing Forge UI: A Story of Designing an App UI System
Forge: Under the Hood
Access to User Activities - Activity Platform APIs
Design Your Next App with the Atlassian Vendor Sketch Plugin
Tear Up Your Roadmap and Get Out of the Building
Nailing Measurement: a Framework for Measuring Metrics that Matter
Building Apps With Color Blind Users in Mind
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
Beyond Diversity: A Guide to Building Balanced Teams
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
Building Apps With Enterprise in Mind

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Big Data Technologies - Introduction.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Electronic commerce courselecture one. Pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Approach and Philosophy of On baking technology
PDF
Modernizing your data center with Dell and AMD
PDF
Encapsulation theory and applications.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
A Presentation on Artificial Intelligence
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation_ Review paper, used for researhc scholars
Big Data Technologies - Introduction.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
20250228 LYD VKU AI Blended-Learning.pptx
MYSQL Presentation for SQL database connectivity
Chapter 3 Spatial Domain Image Processing.pdf
Electronic commerce courselecture one. Pdf
The AUB Centre for AI in Media Proposal.docx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Unlocking AI with Model Context Protocol (MCP)
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Approach and Philosophy of On baking technology
Modernizing your data center with Dell and AMD
Encapsulation theory and applications.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf

Tracking Huge Files with Git LFS