git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Recovering the index after a git crash?

From
MMMikael Magnusson <mikachu@gmail.com>
Date
Feb 6, 2009, 13:38 UTC
Message-ID
<237967ef0902060538r1189573aob15c8e40512343ce@mail.gmail.com>
In-Reply-To
<vpqljsma99t.fsf@bauges.imag.fr>
2009/2/4 Matthieu Moy <Matthieu.Moy@imag.fr>:
Show 11 quoted lines
> Hi,
>
> I'm debugging a git assertion failure, which leaves a .git/index.lock
> in the way. After running the failed command, git refuses to do
> anything in this directory, complaining with:
>
>  fatal: unable to create '.git/index.lock': File exists
>
> What I'm doing then is just "rm .git/index.lock". Is it safe to do it?
> I guess I should just make sure there's no git process running, but is
> there anything else to check?

It should be safe, yes. Often it is even safe to remove .git/index itself, since you can restore it from the latest commit with 'git reset'.

-- 
Mikael Magnusson
Previous: Sverre RabbelierNext: Matthieu Moy
Message 4 of 9 in “Recovering the index after a git crash?”
  1. Matthieu MoyFeb 4, 2009
  2. More friendly message when locking the index fails.Matthieu Moy, Feb 4, 2009
  3. Sverre RabbelierFeb 4, 2009
  4. Mikael MagnussonFeb 6, 2009
  5. More friendly message when locking the index fails.Matthieu Moy, Feb 6, 2009
  6. More friendly message when locking the index fails.Matthieu Moy, Feb 6, 2009
  7. Junio C HamanoFeb 7, 2009
  8. More friendly message when locking the index fails.Matthieu Moy, Feb 19, 2009
  9. Sverre RabbelierFeb 19, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.