How Git LFS Works?

Many teams use Git Large File Storage — also known as Git LFS — to manage and store large files. Here is a break down what Git LFS does and when to use it.

Can Git Handle Large Files?

Git cannot handle large files on its own. That’s why many Git teams add Git LFS to deal with large files in Git. 

What Is Git LFS (Git Large File Storage)?

Git LFS is a Git extension used to manage large files and binary files in a separate Git repository.

Most projects today have both code and binary assets. And storing large binary files in Git repositories can be a bottleneck for Git users.

That’s why some Git users add Git Large File Storage (LFS).

How Does Git LFS Work?

Git LFS uses pointers instead of the actual files or binary large objects (blobs).

So, instead of writing large files/blobs to a Git repository, you write a pointer file, and the files/blobs themselves are written to a separate server. Plus, with Git LFS, multiple servers can be used.

Getting started is fairly straightforward. You download the extension and configure your file types.

Using Git LFS makes it possible to version large files (and manage blobs) while freeing up space in Git repositories. And Git LFS is often a fix for pushing large files to GitHub.

Is Git Large File Storage Free?

Git LFS allows you to store 1 GB for free. IF this is not enough, you can purchase additional storage. For most industries, especially game development, 1 GB is simply not enough.

Should I Use Git LFS? 

You should use Git LFS if you have large files or binary files to store in Git repositories.

That’s because Git is decentralized. So, every developer has the full change history on their computer. And changes in large binary files cause Git repositories to grow by the size of that file every time the file is changed (and that change is committed). That means it will take ages to get the files. And if you do, it will be difficult to version and merge the binaries.

So, every time the files grow, the Git repository grows. And when Git users need to retrieve and clone a repository, this creates problems.

Git LFS was created to solve these problems. But it has problems of its own.

Alternatives to Git LFS

Git LFS isn’t the only way to manage large files in Git. There are alternatives.

This includes other open source or third party fixes, such as:

  • git-annex
  • git-bigfiles
  • git-fat
  • git-media
  • git-bigstore
  • git-sym

But, just like Git LFS, these Git large file storage options can create problems. There’s a better way to manage large files and binary files.

The Best Version Control for Large File Storage: Helix Core

Today’s projects are bigger, with more files and mixed assets than ever before. Git and Git LFS alone can’t manage that. But Helix Core can.

Helix Core — version control software from Perforce — is the best option for managing large binary files. That’s because large file storage is a native capability, not an add-on. And it’s bulletproof.

In Helix Core, you can store binaries alongside your source code. In fact, all of your largest files — binary files, source code, art files, video files, images, libraries, and build artifacts — can live together in a single repository. Without slowing down large, distributed teams.

Source: https://www.perforce.com/blog/vcs/how-git-lfs-works

Leave a Comment

Your email address will not be published. Required fields are marked *