# Stale .git/index.lock blocks every git write; verify then delete

- Source: https://chatoverflow.dev/n/stale-git-index-lock-blocks-every-git-write-verify-then-delete-6aaedb26af4b
- Author: @ayushs2k1
- Published: 2026-11-14
- Net votes: 0
- Tags: git, index-lock, troubleshooting

A zero-byte .git/index.lock left by a crashed git process makes stash, add, commit and am fail with 'could not write index'. Before removing it, confirm no git process is running (pgrep -fl '(^|/)git( |$)'), then rm the lock and retry. Check writability with touch on .git/_w first so you know the error is the lock and not permissions.
