index.lock exists 🌿 Git

fatal: Unable to create '.git/index.lock': File exists. Another git process seems to be running in this repository

A lock file from another (or crashed) Git process blocks this command.

Seen on: Git

Meaning

Git creates index.lock while modifying the index. IDEs, file watchers or a crashed command can leave it behind.

Common causes

  • Another git command or IDE running
  • A previous git process crashed

⚡ Quick fix

  1. Wait for other git processes to finish
  2. If none are running, delete .git/index.lock

Detailed fix by platform

Git

  1. bash
    ps aux | grep -i git
    rm -f .git/index.lock

How to diagnose

  1. Process — Any git/IDE process running?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.