If Git had a nemesis, it’d be large files. Large files bloat Git’s storage, slow down In 2015, GitHub released Git LFS—a Git extension that hacked around
problems with large files. But Git LFS added new complications and
storage costs. Meanwhile, the Git project has been quietly working on large files.
And while LFS ain’t dead yet, the latest Git release shows the path
towards a future where LFS is, finally, obsolete. Git LFS works by storing large files outside your repo. When you clone a project via LFS, you get the repo’s history and
small files, but skip large files. Instead, Git LFS downloads only the
large files you need for your working copy. In 2017, the Git project introduced partial clones
that provide the same benefits as Git LFS: Partial clone allows us to avoid downloading [large binary assets]
in advance during clone and fetch operations and thereby reduce
download times and disk usage. – Partial Clone Design Notes, git-scm.com Git’s partial clone and LFS both make for: What is a partial clone? A Git partial clone is a clone with a For example, to avoid downloading files bigger than 100KB, you’d
use: Later, Git will lazily download any files over 100KB you need for
your checkout. By default, if I Almost four minutes to check out a single 25MB file! And 50 revisions of that single 25MB file eat 1.3GB of space. But a partial clone side-steps these problems: My filter made cloning 97% faster (3m 49s → 6s), and it reduced my
checkout size by 96% (1.3GB → 49M)! But there are still some caveats here. If you run a command that needs data you filtered out, Git will need
to make a trip to the server to get it. So, commands like
But, for large files, this is the same behavior as Git LFS. Plus, I can’t remember the last time I ran Git LFS foists Git’s problems with large files onto users. And the problems are significant: Large files create problems for Git forges, too. GitHub and GitLab put limits on file size2
because big files cost more money to host. Git LFS keeps server-side
costs low by offloading large files to CDNs. But the Git project has a new solution. Earlier this year, Git merged a new feature: large object
promisers. Large object promisors aim to provide the same
server-side benefits as LFS, minus the hassle to users. This effort aims to especially improve things on the server side, and
especially for large blobs that are already compressed in a binary
format. This effort aims to provide an alternative to Git LFS – Large Object Promisors, git-scm.com What is a large object promisor? Large object promisors are special Git remotes that only house large
files. In the bright, shiny future, large object promisors will work like
this: But we’re still a ways off from that bright, shiny future. Git large object promisors are still a work in progress. Pieces of
large object promisors merged to Git in March of
2025. But there’s more to do
and open
questions yet to answer. And so, for today, you’re stuck with Git LFS for giant files. But
once large object promisors see broad adoption, maybe GitHub will let
you push files bigger than 100MB. The Git project is thinking hard about large files, so you don’t have
to. Today, we’re stuck with Git LFS. But soon, the only obstacle for large files in Git will be your
half-remembered, ominous hunch that it’s a bad idea to stow your MP3
library in Git. Edited by Refactoring
English Later, other Git forges made their own
LFS servers. Today, you can push to multiple Git forges or use an
LFS transfer agent, but all this makes set up harder for contributors.
You’re pretty much locked-in unless you put in extra effort to get
unlocked.↩︎ File size limits: 100MB
for GitHub, 100MB
for GitLab.com↩︎ To see posts by date, check out the archives
git clone
,
and wreak havoc on Git forges.What you can do today: replace Git LFS with Git partial clone
--filter
.git clone --filter='blobs:size=100k' <repo>
git clone
a repo with many revisions of
a noisome 25 MB PNG file, then cloning is slow and the checkout is
obnoxiously large:$ time git clone https://github.com/thcipriani/noise-over-git
Cloning into '/tmp/noise-over-git'...
...
Receiving objects: 100% (153/153), 1.19 GiB
real 3m49.052s
$ du --max-depth=0 --human-readable noise-over-git/.
1.3G noise-over-git/.
$ ^ 🤬
$ git config --global alias.pclone 'clone --filter=blob:limit=100k'
$ time git pclone https://github.com/thcipriani/noise-over-git
Cloning into '/tmp/noise-over-git'...
...
Receiving objects: 100% (1/1), 24.03 MiB
real 0m6.132s
$ du --max-depth=0 --human-readable noise-over-git/.
49M noise-over-git/
$ ^ 😻 (the same size as a git lfs checkout)
git diff
, git blame
, and
git checkout
will require a trip to your Git host to
run.git blame
on
a PNG 🙃.Why go to the trouble? What’s wrong with Git LFS?
The future: Git large object promisors
The future of large files in Git is Git.
To see posts by date, check out the archives