1 minute read

Basic Information

System: ๐ŸชŸ๐ŸŽ๐Ÿง

Openness: ๐Ÿ†“๐Ÿ“–

Related Sites:

Introduction

Git LFS is an extension to Git. It can separate large files tracked in Git repositories from ordinary text files. When a pull or push operation occurs, large files are downloaded or uploaded through a dedicated large file server. The originally retained large files in the Git repository will be replaced by pointers to the real storage addresses of the large files.

Generally speaking, the large files here specifically refer to large files in file formats that Git cannot analyze in depth. For source code files, Git can track their line-by-line changes, so even if the file itself is large, as long as a lot of adjustments are not made every time, the final storage volume will not be large. Of course, plain text files that change drastically every time, such as business data tables, are still not suitable for being placed directly in the Git repositories. You can use Git LFS or use a dedicated database service.

Git LFS helps reduce the size of the Git code repository and makes it easier to manage projects that mix code and other file types.

You may think that eventually, both code and large files need to be uploaded to the cloud, which does not reduce the demand for cloud space. But I want to remind you that if you donโ€™t separate the large files from the code repository, a simple clone operation will download all the history edition of any large files. This will cause the local repository to be very bloated.

It should be noted that Git LFS itself is just a protocol and client. It does not include a large file server implementation per se. So if you want to build a complete cloud service with Git LFS support, you also need a server software that implements the Git LFS protocol. Check the list of official wiki: