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

Re: Locking the repository

From
Linus Torvalds <torvalds@osdl.org>
Date
May 6, 2005, 16:15 UTC
Message-ID
<Pine.LNX.4.58.0505060913460.2233@ppc970.osdl.org>
In-Reply-To
<20050506123122.GF11506@cip.informatik.uni-erlangen.de>
On Fri, 6 May 2005, Thomas Glanzmann wrote:
>
> I need a way to lock a repository for certain actions.

Nope - if you want to serialize something, you'll need to write your own serialization scripts. git doesn't care, because all the git operations should be totally lockless already. There just isn't any reason to lock as far as git is concerned, since the objects are immutable.

The only exception is the "index" file, where we don't want concurrect index updates. So that is handled by writers creating the new "index.lock" file first, and then when they are done, they rename it to "index".

		Linus
Previous: Thomas Glanzmann
Message 2 of 2 in “Locking the repository”
  1. Thomas GlanzmannMay 6, 2005
  2. Linus TorvaldsMay 6, 2005

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.