Git cannot-lock-ref Git could not update a specific branch pointer because it is locked or corrupted.
Reviewed for reference consistency: April 11, 2026
Code is Safe
SECUREGit has paused the operation to protect your code. No data has been lost or corrupted.
What To Know
Where Did It Fail?
Commands That Trigger This
TEST on Windows when a branch named test already exists.git/refs/heads/main fileTechnical Background
On macOS and Windows, filesystems are case-insensitive. If remote developers create branches differing only by capitalization, your local Git client will try to write two different branches into the exact same file, causing a lock failure.
Non-corruption variants usually come from a stale lock, a competing Git process, or a ref-name collision that prevents Git from claiming the branch pointer cleanly.
Underlying Causes
Frequently Asked Questions
Index lock affects the staging area (all files). Ref lock affects only the specific branch pointer you are trying to update.