← Blog

How to manage large game assets without Git LFS

Updated · 3 min read

To manage large game assets without Git LFS, keep your assets/ folder out of Git (via .gitignore) and store binaries in content-addressed object storage referenced by a small, committed manifest file in Git—or use a dedicated binary VCS like Perforce or Unity Version Control if you have a larger art team.

Why Git and Git LFS cause friction on game repos

Standard Git stores every historical version of every binary file in .git/objects. Re-exporting a 20 MB .glb mesh or .wav soundtrack ten times adds 200 MB permanently to every clone, and can trip GitHub's 100 MB single-file rejection.

Git LFS helps keep the Git history smaller, but introduces common operational headaches:

  • Teammates or CI runners without git-lfs installed silently check out 130-byte text pointer files instead of real assets.
  • Bandwidth quotas (especially on GitHub LFS) can block clones mid-sprint if several people or CI jobs pull large textures.
  • Coding agents frequently forget to run git lfs track before committing new file extensions, sneaking raw binaries into Git history anyway.

Three practical alternatives to Git LFS

1. S3 / Cloudflare R2 + a lockfile script (DIY)

If you want full control on your own cloud account:

  1. Add assets/ to .gitignore.
  2. Write a small script (scripts/sync-assets.mjs) that hashes each file in assets/ with SHA-256, uploads missing hashes to an S3 or R2 bucket, and writes a sorted assets.lock file (<sha256> <size> <path>).
  3. Commit assets.lock to Git. On another machine, run the script in pull mode to download the exact hashes listed for the current branch.

Because every blob is keyed by its SHA-256 hash, renames and branch switches never re-upload unchanged files, and every Git commit remains reproducible.

2. Perforce (Helix Core) or Unity Version Control (Plastic SCM)

For studios with multiple 3D artists editing binary scenes (.uasset, .unity, .blend) simultaneously, Perforce and Plastic SCM provide native file locking (preventing unmergeable binary conflicts) and handle multi-gigabyte repositories out of the box. The main trade-off is heavier server setup and unfamiliar workflows if you're primarily working with Git and coding agents.

3. Built-in assets.lock on Pita

Pita implements the content-addressed manifest pattern out of the box so you don't have to maintain bucket credentials or sync scripts:

  1. Keep heavy binaries (textures, audio, 3D models, fonts—up to 256 MB per file) in assets/ (gitignored).
  2. Run pita assets push (or let your coding agent run it). Pita hashes each file, uploads only what isn't already stored, and updates assets.lock:
4f2a9c... 18432910 models/hero.glb
91e7b0...  6214012 audio/boss-theme.ogg
c801f3...  2048192 textures/arena_albedo.webp
  1. Commit assets.lock to Git. Teammates and other machines hydrate the exact assets for any commit with pita assets pull.

If a developer or coding agent accidentally commits a binary asset file of 2 MiB or larger directly to Git, Pita's git server prints a push warning reminding them to move it into assets/ and run pita assets push instead.

FAQ

Should I still compress textures and audio even if they aren't in Git?

Yes. Smaller assets mean faster downloads for your players in the browser. Use .webp or KTX2/Basis for textures, Draco compression for .glb meshes, and .ogg/.mp3 instead of uncompressed .wav for music and longer sound effects.

Does moving assets out of Git mean I lose version history?

No, as long as you commit a hash manifest (assets.lock) alongside your code. Checking out an older commit restores the older manifest, and pulling fetches the exact historical asset blobs for that commit.

Related guides