git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Why Git LFS is not a built-in feature

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Nov 14, 2020, 00:29 UTC
Message-ID
<20201114002902.GN6252@camp.crustytoothpaste.net>
In-Reply-To
<CAD9n_qjKyxNjtd1YrcHzshLg0-vbwXkHRwMveXHAWSOXMWLKAg@mail.gmail.com>
On 2020-11-13 at 09:45:52, Alireza wrote:
Show 8 quoted lines
> Currently, having to set up git-lfs in each client and checking server
> compatibility is a huge barrier for using it in the first place,
> whilst it is generally a good practice to store large files in lfs.
> 
> As a consequence a lot of repos are not using it when they should.
> 
> Is there any reason that we don't have built-in support for such an
> important feature?
There are a couple reasons that it's not a built-in feature:
* First, there are several options in this space.  Git LFS is one,
  git-annex is another, and some people prefer to store large objects in
  the repository and use partial clone.  Git, as a project, tries to be
  flexible and meet the needs of various kinds of users without
  privileging one or another external tool.
* Git LFS is a complicated piece of software and it's currently written
  in Go, which is different from most of Git.  Re-implementing it in C
  would be burdensome, and there's little interest in maintaining Go
  software in the Git project.
* Git LFS uses a different protocol from Git, requiring additional
  configuration and a separate server-side component.
* The smudge and clean filter approach has some limitations, among them
  that users who don't have the external filter installed can commit
  uncleaned objects that then result in the working tree consistently
  being modified, even after git reset --hard.

It's my hope that the built-in support for partial clone will mature enough to the point where that's a clear win and the need for external tools isn't as great, since I think that will ultimately provide a better experience for users. Some people are already using it. So in some sense, we do have this as a built-in feature, maybe just not the one you were expecting.

Additionally, in many cases, projects can avoid the need for storing large files at all by using repository best practices, like not storing build products or binary dependencies in the repository and instead using an artifact server or a standard packaging system. If possible, that will almost always provide a better experience than any solution for storing large files in the repository.

Finally, if you do want to use an external tool like Git LFS, it's reasonably straightforward to specify a script to install and configure the required dependencies for your project on each system so that everything just works. One popular location for this kind of path is script/bootstrap.

-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US
Previous: AlirezaNext: Konstantin Ryabitsev
Message 2 of 6 in “Why Git LFS is not a built-in feature”
  1. AlirezaNov 13, 2020
  2. brian m. carlsonNov 14, 2020
  3. Konstantin RyabitsevNov 14, 2020
  4. Ævar Arnfjörð BjarmasonNov 14, 2020
  5. Partial clone demo for large files (Re: Why Git LFS is not a built-in feature)Christian Couder, Nov 18, 2020
  6. brian m. carlsonNov 14, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.