Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do I gain by using git lfs?

Tags:

git

git-lfs

I understand that git lfs replaces the lfs tracked files with pointer files in my repository.

What I don't understand is what I gain from that happening.

Is it just that I never have to download the binary files associated with commits that I never checkout?

Or are there other advantages?

like image 641
Bob Roberts Avatar asked Jun 24 '16 15:06

Bob Roberts


People also ask

What is the point of git LFS?

Git LFS (Large File Storage) is a Git extension developed by Atlassian, GitHub, and a few other open source contributors, that reduces the impact of large files in your repository by downloading the relevant versions of them lazily.

What does git LFS fetch do?

You can configure Git LFS to only fetch objects to satisfy references in certain paths of the repo, and/or to exclude certain paths of the repo, to reduce the time you spend downloading things you do not use. In your Git configuration or in a . lfsconfig file, you may set either or both of lfs.

Does git LFS reduce repo size?

Unfortunately, unless you rewrite history and purge those files, the repo size will not shrink. The reason being that the files are still in commit history, even if they are deleted from HEAD.


1 Answers

It boils down to the reduction of clone time, storage space - for those who clone the repository - and network bandwidth use for both the client and repository server.

It may be just that for the average user and some even see it as big disadvantage since lfs introduces centralization, at least of parts of the repository.

But especially for companies and git services that have many users and/or many versions of big binary files, this can be a great saving of resources like storage, bandwidth, cpu time and so on. These are normally very centralized anyway and could f.e. throttle usage of the LFS server while maintaining the "normal service".

The Roadmap includes a bit more, like metrics, resumable downloads which would be new and maybe advantageous to the normal git with big files. The rest is more or less an improvement for lfs.

like image 51
makadev Avatar answered Oct 06 '22 09:10

makadev