Unity Prefab Git Review
How to Review Unity Prefab Changes in Git
To review a Unity prefab in Git, compare the correct branch or commit range, then classify changes into object hierarchy, components, serialized properties, nested prefab sources, instance overrides, and references. A raw .prefab diff is evidence, but it is not the most useful review model.
Compare the intended prefab revisions
git diff origin/main...HEAD -- Assets/Prefabs/Enemy.prefab
git log --follow -- Assets/Prefabs/Enemy.prefab
git show <commit>:Assets/Prefabs/Enemy.prefab
Use the three-dot range for feature-branch changes since divergence. Use exact commits when investigating history. Include the prefab's .meta file and any related source prefabs, scripts, materials, or ScriptableObjects.
Classify the prefab change
- Object structure: added, removed, renamed, reparented, or reordered children.
- Components: additions, removals, ownership, and script GUID changes.
- Properties: transforms, flags, serialized fields, and arrays or lists.
- Nested prefab links: source GUIDs and source object fileIDs.
- Overrides: target object, property path, and resulting local value.
- References: local and cross-asset targets behind GUID/fileID pairs.
Use semantic prefab review
MergeSight prefab change review groups the supported YAML records by Unity object, component, property, hierarchy, reference, and override context. Review Mode can compare working-tree, branch, or commit sources and filter both the asset list and individual semantic rows.
This is especially valuable for nested prefabs because one conceptual source-link or override change can be distributed across multiple YAML records.
Questions to answer before approval
| Area | Question |
|---|---|
| Hierarchy | Does each changed child still have the intended parent and sibling position? |
| Ownership | Is each component attached to the expected GameObject? |
| Override | Is the value intentionally local, or should the source prefab own it? |
| Nested source | Does the instance still point to the expected prefab and source object? |
| Reference | Can the reviewer name the asset or object behind every important changed GUID/fileID? |
| Deletion | Was content intentionally removed, or did a source/override change make it disappear? |
Validate the prefab in Unity
- Open the prefab in Prefab Mode using the project's documented Unity version.
- Check Console import and serialization errors.
- Inspect missing scripts, broken object references, and unexpected overrides.
- Open representative scene instances and confirm behavior or visual state.
- Run targeted EditMode, PlayMode, or build checks where the prefab affects runtime systems.
Remove review noise before merging
Unrelated reserialization, reordered components, mass property normalization, and Unity-version changes can hide the real edit. Split those operations into dedicated commits or branches when possible. If they are unavoidable, state that clearly and provide a semantic summary of the intended subset.
FAQ
How do I see what changed in a Unity prefab in Git?
Run git diff for the intended branch or commit range and prefab path. Then inspect hierarchy, components, properties, nested prefab sources, overrides, and resolved references.
Why are Unity prefab Git diffs hard to read?
Prefab meaning is distributed across serialized objects, fileIDs, source links, and override records. Git shows lines but does not group them by Unity ownership or hierarchy.
Should prefab meta files be reviewed too?
Yes, especially for added, moved, renamed, or replaced prefabs. The meta file contains the GUID used by references throughout the project.
Can MergeSight compare a prefab between commits?
Yes. MergeSight supports branch, commit, and working-tree review sources for supported text-serialized Unity assets.
Summary
Compare exact revisions
Use the correct Git range and include source, dependency, and meta changes.
Classify prefab meaning
Separate hierarchy, components, properties, nested sources, overrides, and references.
Validate real instances
Open Prefab Mode and representative scene instances before approval.
The goal of prefab review is to explain what the prefab will mean in Unity, not to approve a mechanically valid YAML patch.
Next step
For multi-level source relationships, continue with Unity Nested Prefabs Explained.