version v7.2.
For up-to-date documentation, see the
latest version.
LFS
3 minute read

Understanding Git LFS
Git Large File Storage (LFS) is a Git extension that handles large binary files more efficiently by storing them separately from your Git repository.
The problem
Git stores every version of every file. This creates issues with large binary file:
- Repository can grow rapidly
- Slow clone/fetch operations
- Wastes bandwidth and disk space
This becomes a bottleneck in workflows during cloning and fetching repositories with large binary files.
The Solution
Git LFS was developed to address these issues by efficiently managing large files.
Git LFS replaces large files with lightweight pointers (~130 bytes) and stores actual files separately: Optimized Storage, enhances speed when cloning, fetching, and storing repository data.
Git LFS workflow involves the following steps:
- Add file → Stored in LFS, pointer committed to Git
- Push → File transferred to LFS server
- Clone → Only pointers downloaded
- Checkout → Files fetched from LFS on-demand
Use Cases Guidance
✅ Good Use Cases:
- Frequently Modified Binary Files (Images, 3D models, audio/video updated regularly)
- Large Binary Build Artifacts for Testing (Test datasets, compiled binaries for CI/CD)
❌ Avoid Git LFS:
- Build Artifacts, like JAR files, Docker images, release packages, as Git is not a package manager.
- Use instead: JFrog Artifactory or Maven repositories, Docker registries
- Generated/Temporary Files: These shouldn’t be in version control at all.
- Use instead: Add to
.gitignore
- Use instead: Add to
- Small Files (< 5 MB), as Regular Git handles efficiently; LFS adds complexity without benefit.
- Files Requiring Merge/Conflict Resolution, LFS cannot merge binary files, conflicts require choosing one version.
CheckList
- Identify if there is files > 10 MB that change frequently
- Confirm files are not build artifacts
- Decide GitLab or Artifactory backend (cf Comparison Section )
- Install Git LFS on all dev machines and Document LFS usage in
README - Create and Commit
.gitattributeswith tracking patterns - Monitor LFS storage growth
- Clean up unused LFS objects
GitLab vs Artifactory Comparison
Within the Software Factory, two tools support Git LFS. Choose based on your needs:
GitLab LFS
Advantages:
- Zero configuration - works out of the box
- Same authentication as Git
- Integrated in GitLab UI
- Automatic backups with GitLab
Disadvantages:
- Limited management capabilities
- Single purpose (only Git LFS)
- Rate Limits (Find more details on your platform
for
Max authenticated requests per period per user…)
GitLab LFS is Best For
- Teams not using Artifactory
- Simple workflows
- LFS storage < 100 GB
- Projects where simplicity matters
Artifactory LFS
Advantages:
- Unified artifact management (LFS + Maven + Docker + npm)
- Artifactory QL , replication, advanced access control
- Virtual repositories for aggregation
Disadvantages:
- Requires separate configuration
- Not visible in Git UI
- Separate authentication
Artifactory LFS is Best For
- ✅ Large LFS storage needs (> 100 GB)
- Teams already using Artifactory
- Need for advanced artifact management
- Want all binaries in one platform
Decision Matrix
| Factor | GitLab LFS | Artifactory LFS |
|---|---|---|
| Setup Complexity | Simple (enabled by default) | Moderate (requires configuration) |
| Best For | Small-medium usage (< 100 GB) | Large usage (> 100 GB) |
| Management | Basic | Advanced (AQL, policies, replication) |
| Integration | Tight with GitLab | Unified with all artifacts |
| Use If | Not using Artifactory | Already using Artifactory |
AVS team have a dedicate page to Migrate from GitLab LFS to Artifactory LFS where they explain the reasons to make the move.