Git LFS keeps large binaries out of ordinary Git object history, but it does not remove the need for storage planning, access control, monitoring, and tested backups. This guide explains how to choose Git LFS hosting, configure repositories, migrate oversized files safely, track quotas, and create a repeatable maintenance schedule for teams using hosted or self-hosted Git infrastructure.
Overview
Git Large File Storage, usually called Git LFS, replaces selected files in a Git repository with small pointer files. The actual binary content is stored in an LFS object store and downloaded when a working tree needs it. This model is useful for design assets, media, machine-learning artifacts, compiled packages, game assets, and other files that change too often or weigh too much for ordinary Git history.
LFS is not a general backup system and it is not automatically included in every repository backup. A repository administrator must account for two related but separate data sets:
- Git data: commits, trees, blobs, branches, tags, and repository configuration.
- LFS data: binary objects addressed by their hashes, plus the server-side storage and access rules that make those objects available.
Before selecting a developer hosting platform, confirm that it supports Git LFS for the repository type and workflow you intend to use. Then verify the details that tend to vary by installation or plan: storage limits, transfer allowances, project or namespace quotas, authentication methods, administrative reporting, object retention, and backup access. Treat provider documentation and your own installed version as the source of truth rather than relying on an old comparison.
For broader platform decisions, see the guide to choosing an open-source Git hosting platform for teams. Git LFS is one capability within a larger hosting and deployment design.
What to track
Repository patterns and file ownership
Start with an explicit policy for what belongs in LFS. A typical configuration uses patterns rather than individual filenames:
git lfs install
git lfs track "*.psd"
git lfs track "assets/video/**"
git lfs track "models/**"
git add .gitattributes
git commit -m "Track large assets with Git LFS"
The .gitattributes file is part of the Git repository, so review it like source code. Check that patterns cover new files without accidentally moving source files, lockfiles, or small text assets into LFS. Record who owns each large-file category and whether the files are reproducible, licensed for redistribution, or subject to retention requirements.
Capacity and transfer indicators
Maintain a simple inventory for each repository or project:
- LFS object storage currently consumed.
- Growth since the previous review.
- Largest objects and the teams or workflows producing them.
- Download or transfer volume, where the host exposes it.
- Configured quota, remaining headroom, and any warning threshold.
- Number of active branches, tags, releases, and archived projects containing LFS files.
- Date and result of the last LFS backup and restore test.
Use Git’s local inspection commands when diagnosing a repository:
git lfs ls-files
git lfs status
git count-objects -vH
git lfs env
These commands show different parts of the picture. Local output should not be treated as a complete server-side quota report. A host may count shared objects, transfers, deleted references, or backup copies differently from the client.
Hosting support and operational fit
The following comparison is a decision framework, not a statement of current limits or feature availability. Confirm support and quota behavior for the exact edition, version, and deployment you operate.
| Hosting option | What to verify | Best fit to evaluate |
|---|---|---|
| GitLab-hosted or self-managed | LFS enablement, namespace and project limits, transfer accounting, administrative storage reporting, and backup procedure | Teams wanting an integrated repository, review, issue, and CI/CD platform |
| Forgejo | Git LFS configuration, object storage settings, authentication, quota visibility, and backup coverage for the selected release | Teams seeking an open-source, self-hosted collaboration platform with control over infrastructure |
| Gitea | LFS enablement, storage backend, repository migration behavior, quotas, and how LFS objects are included in backups | Small teams and operators evaluating a lightweight self-hosted Git service |
| Other self-hosted Git services | Protocol support, access-token behavior, reverse-proxy limits, object storage durability, monitoring, and restore documentation | Organizations with existing infrastructure or specialized compliance requirements |
For self-hosted Git LFS, document the location of LFS objects separately from the Git repository storage. If an external object store is used, include its credentials, encryption settings, lifecycle rules, and access logs in the operations plan without placing secrets in the repository.
Cadence and checkpoints
A recurring review prevents a sudden quota failure from becoming a release incident. A practical schedule is monthly for active binary-heavy repositories and quarterly for stable projects.
At each monthly review
- Export or record current LFS usage, growth, and remaining capacity.
- Identify new large objects, unexpected transfer spikes, and repositories approaching their warning threshold.
- Confirm that CI jobs, release automation, and developer workstations can authenticate without embedding long-lived credentials.
- Check recent failed downloads and clone errors in server logs or platform dashboards.
- Verify that new repository templates include the team’s LFS guidance and
.gitattributesreview.
At each quarterly review
Run a restore test using a clean environment. Restore the Git repository and its LFS objects, clone with LFS enabled, check out a representative tag, and compare checksums for selected large files. Also review archived repositories, obsolete release assets, object-store lifecycle rules, and the permissions used by backup jobs.
When moving between hosts, test a pilot repository first. A migration is incomplete if commits arrive but LFS pointers cannot download their corresponding objects. Preserve tags and branches, record the old remote, and keep the source available until the new clone, checkout, and CI workflows have passed validation.
How to interpret changes
Rapid storage growth can indicate legitimate product work, but it can also reveal a pattern problem. A binary that is regenerated on every build may belong in an artifact repository or deployment storage instead of Git LFS. Repeatedly changing exported archives may need a release policy that retains only approved versions. Large test fixtures may be better generated during CI, provided the generation process is deterministic and documented.
A sudden transfer increase deserves a different investigation from a storage increase. Transfer may rise because a CI job repeatedly performs full LFS checkouts, developers are cloning large histories unnecessarily, or a release process downloads the same objects many times. Inspect job logs, checkout depth, caching, and release automation before changing quotas.
Do not delete LFS objects merely because a branch or tag disappeared. Object reachability and server garbage collection vary by platform, and an apparently unused object may still be required by a retained reference or backup. Use the host’s documented cleanup procedure, establish a retention window, and test recovery before removing data.
Use this storage-policy template as a starting point:
- Allowed: source-adjacent binaries that cannot be reasonably regenerated and must be versioned with code.
- Not allowed: secrets, temporary build output, dependency caches, and unrestricted personal files.
- Ownership: each LFS pattern has a technical owner and a retention decision.
- Warning threshold: administrators receive notice before the configured capacity becomes operationally risky.
- Backup: Git data and LFS objects are backed up separately and restored together in tests.
- Review: usage, quotas, authentication, and provider limits are reviewed monthly or quarterly.
When to revisit
Revisit this guide at least every six months and immediately after a Git hosting upgrade, migration, storage-backend change, pricing or capacity change, authentication change, or major Git LFS client release. Also schedule an earlier review when a repository adds a binary-heavy workflow, approaches its warning threshold, records repeated download failures, or changes its backup architecture.
Use the following checklist during the next review:
- List every repository using LFS and record its current storage and growth.
- Confirm that the selected hosting platform and installed version still support the required LFS workflow.
- Review
.gitattributespatterns and remove accidental tracking rules through a planned, tested migration. - Test authentication from a developer machine and a CI runner using short-lived or narrowly scoped credentials where supported.
- Back up Git repositories and LFS objects independently, then perform a clean restore and checksum check.
- Update quotas, ownership, retention rules, and the next review date in the team’s operations documentation.
For the wider disaster-recovery process, consult the self-hosted Git server backup and disaster recovery guide. If LFS is part of an automated deployment path, pair this review with your Git deployment and rollback procedure. Treat Git LFS as production data: measure it, protect it, and verify that it can be recovered before the next large release depends on it.