Interview Prep/Git & GitHub/Submodules, LFS and Hooks

`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.

All Git & GitHub questions Roadmap: Git & GitHub

More on Submodules, LFS and Hooks