Overview
The FBW Aircraft repository contains a lot of large binary files. These are the type of files git is not optimized for. As they are binary files, git is not able to track changes to the files, except by storing the file entirely every time a change happens.
This presents unique challenges for our developers and our build environments:
- The repository gets unwieldy large, as storing the entire history of every file is expensive
- Every checkout/clone requires to pull a large chunk of data, data that might not be necessary for making changes to something that is only code.
- Build systems have to sometimes gather more data than needed.
The solution that is being investigated, is migrating the repository to use Git LFS. A solution designed to host binary data in a special server designated to host these files and integrate with git automatically.
Git LFS
Git Large File Storage (Git LFS) is an extension for Git, the widely used version control system. It addresses a fundamental limitation of Git, which is not designed to handle large files or binary assets very efficiently. Here's a concise summary of what Git LFS is:
-
Purpose: Git LFS is designed to deal with large files separately from regular text files. It's particularly useful for projects that involve large files, such as graphics, videos, audio files, or large datasets.
-
How It Works: Instead of storing the large files directly in the Git repository, Git LFS stores pointers to these files in the repository, while the actual files are stored in a separate LFS server. When you clone, pull, or push changes, Git LFS fetches the correct versions of the large files from the LFS server.
-
Efficiency and Performance: By handling large files outside the main Git repository, Git LFS improves performance. Repositories are smaller and faster, as the large files are not constantly transferred or processed.
-
Ease of Use: For users, the process is mostly transparent. Once Git LFS is installed and configured, it automatically manages large files according to the settings defined in the
.gitattributes
file. -
Storage: The LFS server can be self-hosted, or it can be a cloud service. Providers like GitHub, Bitbucket, and GitLab offer integrated Git LFS support.
-
Limitations: There are storage and bandwidth limits for LFS files, especially on cloud services, which can incur additional costs.
Git LFS is particularly beneficial for developers and teams working with large digital assets, as it ensures that the Git repository remains efficient and fast, while still tracking and versioning large files effectively.