`git push` fails with `Unable to push locked files:` and `ERROR: Cannot update locked files.`
AdvancedTroubleshootingSubmodules, LFS and Hooks
Answer
Likely causes → The repo uses Git LFS file locking (common for binary assets like PSDs or Unity scenes). You modified a file that someone else locked, and the server rejects the push.
Diagnose →
git lfs locks
git lfs locks --path=art/hero.psd
Fix → Coordinate with the lock owner; once they unlock (git lfs unlock art/hero.psd), lock it yourself, rebase and push. An admin can break a stale lock: git lfs unlock art/hero.psd --force. Your own edits may need to be redone, since binary files cannot be merged.
Prevent → Mark lockable types in .gitattributes (*.psd filter=lfs diff=lfs merge=lfs -text lockable) so they are read-only until you git lfs lock them.
More on Submodules, LFS and Hooks
`fatal: No url found for submodule path 'libs/common' in .gitmodules`IntermediateAfter cloning, the submodule directories exist but are empty.Beginner`git submodule update` fails: `fatal: remote error: upload-pack: not our ref 3f2a9c1...` and `Fetched in submodule path 'libs/common', but it did not contain 3f2a9c1. Direct fetching of that commit failed.`Intermediate`git status` keeps showing `modified: libs/common (new commits)` even though you never touched it.BeginnerYou committed inside a submodule, ran `git submodule update`, and your commits vanished.Intermediate`git submodule add` fails with `fatal: 'libs/common' already exists in the index`.Intermediate