Unity Git LFS Guide

Unity Git LFS: Which Assets Should Use It?

Use Git LFS for large binary source assets that produce expensive Git history and cannot be meaningfully merged. Keep text-serialized Unity assets, scripts, settings, package files, and .meta files in normal Git so diffs, references, and merge tools remain useful.

7 Wolves July 29, 2026 8 min read Git Setup

The decision rule

An asset is a strong LFS candidate when all three statements are true:

  1. The file is large enough that repeated revisions materially grow clone and fetch cost.
  2. The format is binary or its textual representation is not useful for code review.
  3. The team does not expect Git's normal line diff or merge algorithm to combine edits.

File extension is a useful starting point, but actual size and edit frequency matter. A tiny WAV used once is different from a multi-gigabyte source video revised every week.

Assets that usually belong in LFS

  • Layered art sources such as .psd and large .tif files.
  • 3D source formats such as .fbx, .blend, and CAD-derived assets.
  • High-resolution textures, HDR images, and scan data when repository size warrants it.
  • Audio masters, voice recordings, music stems, and video files.
  • Large archives or generated binary data that genuinely must be versioned.

These formats often also benefit from locking because concurrent binary edits cannot be merged.

Assets that should usually stay in normal Git

FileWhy normal Git helps
.unity, .prefabForce Text enables Unity-aware diff and Smart Merge workflows.
.asset, .matSerialized properties, references, and material changes can remain reviewable.
.metaGUID and importer settings must stay visible and travel with the asset.
.cs, shaders, JSON, YAMLNormal Git history, blame, diff, and merge remain valuable.
ProjectSettings/, Packages/Small text configuration should be auditable in pull requests.

Keeping Unity text assets outside LFS also allows MergeSight semantic Unity asset review to compare and merge their real content instead of seeing only LFS pointers.

Add LFS rules safely

git lfs install
git lfs track "*.psd"
git lfs track "*.fbx"
git lfs track "*.wav"
git add .gitattributes
git commit -m "Configure Git LFS for binary source assets"

Commit .gitattributes so every clone uses the same rules. Verify with git check-attr -a -- path/to/file and git lfs ls-files.

Existing files and history need separate treatment

git lfs track affects files added under the rule going forward. It does not rewrite earlier commits. Moving existing history to LFS with git lfs migrate changes commit IDs and can disrupt open branches, pull requests, tags, and clones.

Before a migration, measure repository growth, document the cutoff, back up the remote, test in a disposable clone, coordinate a freeze, and publish exact re-clone or reset instructions.

Storage and locking are different decisions

LFS storage reduces normal Git object growth. LFS locking coordinates exclusive edits. A file can need LFS without needing a lock, and a high-risk asset can need temporary ownership even when it remains in normal Git.

Choose locks for non-mergeable formats or consistently expensive conflicts. Do not mark every LFS file lockable if parallel revisions are acceptable.

Audit the LFS policy

  • List the largest Git objects and frequently revised binary paths.
  • Compare extension rules with actual file sizes.
  • Check that scenes, prefabs, materials, meta files, and scripts were not captured accidentally.
  • Confirm that CI and build machines fetch required LFS objects.
  • Review hosting quotas, retention, and backup behavior before repository growth becomes urgent.

FAQ

Which Unity files should use Git LFS?

Use LFS for large binary assets such as layered art, 3D source files, high-resolution textures, audio, and video when their revisions materially increase repository size.

Should Unity meta files use Git LFS?

No. Meta files are small text files containing GUIDs and importer settings. Keep them in normal Git and commit them with their assets.

Should Unity scenes use Git LFS?

Usually no. Force Text scenes can be diffed and merged with Unity-aware tools. Put them in LFS only after consciously accepting the loss of normal text review and merge behavior.

Does git lfs track migrate existing history?

No. It configures matching files going forward. Rewriting existing history requires a separate git lfs migrate operation and team-wide coordination.

Summary

Choose by behavior

Large, binary, frequently revised, and non-mergeable files are the strongest LFS candidates.

Protect text workflows

Keep scenes, prefabs, materials, meta files, scripts, and settings in normal Git.

Plan migrations

New rules do not rewrite history; migrate only with measurement, backups, and coordination.

Git LFS is a storage policy, not a blanket Unity configuration. Preserve normal Git wherever text review and merge still provide value.

Next step

After choosing extensions, encode them alongside text merge rules in your Unity .gitattributes file.