File Lock
File Lock
Section titled “File Lock”Textil’s file lock feature prevents binary file editing conflicts before they happen. Cross-branch exclusive control and lineage tracking fundamentally prevent conflicts in team development.
Why File Lock Is Needed
Section titled “Why File Lock Is Needed”Unreal Engine asset files (.uasset, .umap) are binary format. Unlike text files, Git’s automatic merge doesn’t work. When two people edit the same file, one person’s changes must be discarded.
File lock avoids this problem by “declaring before editing.”
Why Not Git LFS Locks?
Section titled “Why Not Git LFS Locks?”Git LFS has a lock feature (git lfs lock), but it has fundamental issues with branch-based development.
- 1Alice locks
Hero.uasseton main - 2Alice edits, commits, and releases the lock
- 3Bob tries to lock the same file on feature branchLock is available, so he acquires it
- 4Bob edits and commits
- 5Merge feature into mainConflict occurs—one person's changes must be discarded
Even if a lock is available, the file may have been edited on another branch. Traditional locks only check “who currently holds it,” so they can’t prevent this problem.
Textil’s Approach: Lineage Tracking
Section titled “Textil’s Approach: Lineage Tracking”Textil’s lock tracks file “lineage.” When acquiring a lock, it verifies whether the requester has the latest state. If not, the lock is denied.
- 1Alice locks
Hero.uasseton main - 2Alice edits, commits, and releases the lock
- 3Bob tries to lock on feature branchDenied: "You haven't incorporated Alice's changes"
- 4Bob runs git merge main to incorporate Alice's changes
- 5Bob tries to lock againSuccess
This verification guarantees that “if you can acquire the lock, you can safely edit.”
Global Scope
Section titled “Global Scope”Textil’s locks are exclusive across branches. When you acquire a lock on one branch, the same file cannot be locked from other branches.
Since binary files cannot be merged, there’s no point in allowing independent locks per branch. Global scope fundamentally prevents merge conflicts.
Content-Based Identity
Section titled “Content-Based Identity”Lineage verification uses Git LFS oid (file content hash). This allows correct tracking even when commit history is rewritten by squash merge or rebase, as long as the file content is the same.
- 1Edit
Hero.uasseton feature branch (oid: abc123) - 2Squash merge to main (new commit, but oid is still abc123)
- 3Another developer tries to lockoid matches, correctly determined as "has latest"
Real-time Sync
Section titled “Real-time Sync”Lock state is shared with the entire team in real-time via WebSocket.
- When someone acquires a lock, everyone is notified immediately
- When someone updates a file (fetch/push), that information propagates to everyone
- Even if connection is lost, latest state is automatically restored on reconnection
This mechanism ensures everyone always sees the same lock state.
Target Files
Section titled “Target Files”The lock feature only applies to files managed by Git LFS. Text files (.cpp, .h, .ini, etc.) can be resolved through Git’s normal merge and are not lock targets.
In typical Unreal Engine projects, the following files are LFS-managed and lockable:
.uasset- All asset files.umap- Level files- Source files for textures, meshes, sounds, and other imported assets