Git LFS for Unreal Engine and Unity: A Practical Setup Guide
Set up Git for an Unreal or Unity project the right way: what to ignore, what goes in Git LFS, file locking, Unity Smart Merge and fixing an old repo.
In this article
Git was built for source code: small text files that change line by line. Game projects are mostly the opposite: large binary files like maps, Blueprints, textures and audio. Put a game project in plain Git and the repository balloons, clones take forever and merges destroy work. With three files set up correctly on day one, Git works well for small teams in both Unreal Engine and Unity.
The three pieces
.gitignore: folders and files Git should never track (things the engine regenerates)..gitattributes: how to treat each file type: text, binary or Git LFS.- Git LFS (Large File Storage): stores big binary files outside the normal history and keeps only small pointers in Git.
Set them up before the first commit. Fixing history later is possible but painful.
Step 1: install Git LFS
Git LFS is an extension that comes with Git for Windows and is easy to add on macOS and Linux. Every developer runs this once:
git lfs install
Step 2: ignore what the engine regenerates
These folders are rebuilt on every machine, can be gigabytes, and change constantly:
| Unreal Engine | Unity |
|---|---|
Binaries/ | Library/ |
DerivedDataCache/ | Temp/ |
Intermediate/ | Obj/ |
Saved/ | Logs/ |
*.sln, .vs/ | UserSettings/, *.csproj, *.sln |
Never ignore Unreal's Content/, Config/, Source/ or the .uproject, or Unity's Assets/ (including all .meta files), Packages/ and ProjectSettings/.
Two Unreal choices to make on purpose:
- Baked lighting (
*_BuiltData.uasset): ignoring it keeps the repo small, but everyone has to build lighting locally. - Plugin binaries: if teammates open the project without a C++ compiler, commit the compiled plugin binaries or they cannot open it.
Step 3: decide what goes in LFS
| File type | Unreal Engine | Unity |
|---|---|---|
| Engine assets | .uasset, .umap → LFS | .unity, .prefab, .asset → text (Force Text) |
| Textures | LFS | LFS |
| Models, scenes from DCC tools | LFS | LFS |
| Audio, video | LFS | LFS |
| Code, config | Text | Text |
The big difference: Unreal assets are always binary, while Unity stores scenes, prefabs and most assets as YAML text when Edit → Project Settings → Editor → Asset Serialization is set to Force Text (the default in current versions). Text files can be diffed and merged, so they should stay in normal Git.
A typical Unreal .gitattributes:
* text=auto *.uasset filter=lfs diff=lfs merge=lfs -text lockable *.umap filter=lfs diff=lfs merge=lfs -text lockable *.png filter=lfs diff=lfs merge=lfs -text *.fbx filter=lfs diff=lfs merge=lfs -text *.wav filter=lfs diff=lfs merge=lfs -text
The free .gitignore & Git LFS Generator writes both files for either engine with these choices as checkboxes, plus the setup commands.
Step 4: lock binary files (Unreal)
Binary assets cannot be merged. If two people change the same map or Blueprint, one of them loses their work. File locking prevents that:
git lfs lock Content/Maps/Shop.umap # ...edit, commit, push... git lfs unlock Content/Maps/Shop.umap
Files marked lockable are read-only on disk until you lock them, which reminds everyone to lock first. Your Git host must support LFS locking.
Unreal Engine 5 also helps with One File Per Actor (used by World Partition): each actor placed in a level is saved as its own small file, so two people can work in the same level as long as they edit different actors.
Step 5: Unity Smart Merge
Unity ships UnityYAMLMerge, a merge tool that understands scenes and prefabs. Point Git at it in your .gitattributes:
*.unity text eol=lf merge=unityyamlmerge *.prefab text eol=lf merge=unityyamlmerge
and configure the driver once per machine, using the UnityYAMLMerge executable inside your Unity Editor installation (the generator shows the config block). Merges of scenes and prefabs then work much more often without manual fixes. Also keep Version Control mode on Visible Meta Files so .meta files are always next to their assets.
Already committed big files?
A new .gitattributes only affects future commits. To move existing files into LFS, rewrite history:
git lfs migrate import --include="*.uasset,*.umap,*.png,*.fbx" --everything
This changes every commit hash. Back up first, make sure everyone has pushed, and have everyone re-clone afterwards.
Hosting and quotas
GitHub, GitLab, Bitbucket, Azure DevOps and self-hosted servers all support Git LFS, but storage and bandwidth limits differ and change over time. Check your host's current LFS quota before pushing gigabytes of art, and remember that every CI run and fresh clone downloads LFS files too.
When Git is not the right tool
For large teams with huge binary repositories, many studios use Perforce, which handles big files and locking natively and integrates closely with Unreal. Unity offers Unity Version Control (formerly Plastic SCM). For a solo developer or a small team, Git with LFS and locking is usually enough.
Summary
- Install Git LFS and add
.gitignoreand.gitattributesbefore the first commit. - Ignore generated folders; never ignore Content, Assets or Unity
.metafiles. - Unreal assets and all binary art go in LFS; Unity YAML scenes and prefabs stay as text.
- Lock Unreal assets before editing; use Smart Merge in Unity.
- Fix old repos with
git lfs migrate, carefully.
Frequently asked questions
Is Git good for Unreal Engine projects?
Yes for small teams, as long as you use Git LFS for .uasset and .umap files and lock binary assets before editing. Larger studios often use Perforce, which handles huge binary repositories and locking natively.
What files should I put in Git LFS?
Large binary files that cannot be merged: Unreal .uasset and .umap, textures (PNG, TGA, PSD, EXR), models (FBX, Blend), audio and video. Code, config and Unity YAML scenes and prefabs stay in normal Git.
Why is my Git repository so big?
Usually binary files committed without LFS (every version stays in history forever) or generated folders that should be ignored, such as Unreal's DerivedDataCache or Unity's Library. Fix the .gitignore and move binaries to LFS with git lfs migrate.
Do I need to commit Unity .meta files?
Yes, always. Each .meta file holds the asset's GUID and import settings. Without them, references between assets break when someone else opens the project.