Field Notes: Assets & Version Control
Practical lessons from projects where the asset pipeline went wrong, usually late and at the worst moment. None of them is clever; all of them are cheaper to follow on day one than to fix in month six.
Set up LFS and locking before the first binary commit
Moving files into LFS later means git lfs migrate, which rewrites every commit hash; everyone has to re-clone, and open branches have to be rebased. Write .gitattributes with your binary types and lockable flags in the first commit, together with .gitignore. Then lock binary assets before editing them, every time, even on a two-person team: the first lost day of art work costs more than a year of typing git lfs lock (Locking Binary Files).
Lowercase extensions, no spaces, ASCII names
Hero.PNG escapes a *.png LFS rule on Linux CI, Lamp Post.fbx breaks a shell script, and Ŝtone.png breaks a build on a machine with a different locale. Pick a naming convention (SM_LampPost, T_Stone_BaseColor) and enforce it in the asset validator (Validating Assets Automatically).
Guard the repository against accidental giants
Someone will eventually commit a 2 GB video capture or a build folder. A pre-commit hook (or a CI check on pull requests) that rejects large files not covered by LFS stops it before it reaches history. Here is the check, verified with real Git:
mkdir game && cd game && git init -q
printf '*.png filter=lfs diff=lfs merge=lfs -text\n' > .gitattributes
git add .gitattributes && git commit -q -m "LFS rules"
head -c 300000 /dev/zero > capture.mp4 # 300 KB, no LFS rule
head -c 400000 /dev/zero > hero.png # in LFS by attribute
echo 'speed = 240' > tuning.txt
git add .
limit=200000
status=0
for f in $(git diff --cached --name-only --diff-filter=AM); do
size=$(git cat-file -s ":$f")
lfs=$(git check-attr filter -- "$f" | cut -d' ' -f3)
if [ "$size" -gt "$limit" ] && [ "$lfs" != "lfs" ]; then
echo "REJECT $f ($size bytes): too big for plain Git; add an LFS rule or don't commit it"
status=1
fi
done
echo "hook exit status: $status"REJECT capture.mp4 (300000 bytes): too big for plain Git; add an LFS rule or don't commit it
hook exit status: 1
git cat-file -s ":path" reads the size of the staged version; with LFS active, hero.png is staged as a tiny pointer, so it passes either way. On a machine without LFS it would pass too but be stored in full, which is why CI should also run the pointer check from Git LFS & .gitattributes. Use a real limit such as a few megabytes, install it with a hook manager or core.hooksPath, and run the same check in CI, because local hooks can be skipped.
Never rename or move assets outside the engine
Unity tracks assets by the GUID in each .meta file; Unreal tracks them by path and leaves redirectors when you move them in the editor. Renaming in Explorer or Finder (or with git mv alone) breaks references silently: missing materials, null prefab fields, broken Blueprints. Move and rename inside the editor, commit the .meta files (Unity) or run Fix Up Redirectors (Unreal) before committing, and review the diff for orphaned files.
Keep sources and exports separate
.blend, .psd, .aseprite and WAV masters are sources; .fbx, .glb, PNG atlases and Ogg files are exports. Keep sources in an Art/Source/ tree (in LFS, lockable), and exports where the engine reads them, generated by a script. Then "how was this made?" always has an answer, and a change in export settings is one command away from every asset.
Calibrate once, trust forever
Before real art arrives, import the calibration kit (1 m cube, FRONT arrow, 1.8 m capsule, numbered checker plane) into each engine you target and fix the export presets until all four arrive correctly (Units, Axes & Scale). Save the presets in the repository. Most "the artist's model is broken" bugs are really "the export settings were different on the artist's machine".
Set budgets before production, not after
Decide triangle, texture and audio budgets per asset category and per platform early (UVs & Texture Memory, LODs & Triangle Budgets). An artist who knows "props: 2k triangles, one 1024² texture set" produces the right asset the first time; one who learns it after delivery has to redo the work.
Your host is not a backup
Git hosts, LFS storage and Perforce servers can lose data, lock accounts or delete repositories over unpaid bills. Keep at least one independent backup of the repository including LFS objects (git lfs fetch --all before archiving) and of any Perforce depot, and test restoring it once.
Test yourself
Why should assets be renamed or moved inside the Unity or Unreal editor rather than in the file explorer?
- It's faster
- The editors keep references (GUIDs in .meta files, redirectors) intact; outside moves break them silently
- File explorers can't rename binary files
- Git requires it
What does git cat-file -s ":hero.png" report?
- The size of the file in the last commit
- The size of the staged (index) version of hero.png
- The LFS server size
- The file's hash
What must a repository backup include for an LFS-based game project?
- Only the .git folder from a normal clone
- The Git history plus all LFS objects, fetched with
git lfs fetch --all - Only the latest build
- Nothing, the host keeps backups