What does the .git / index.lock file do?

I had a problem now when I needed to delete the file .git/index.lock. Without hesitation, I assume that this file somehow blocks processes that can access the git repository. However, I cannot find a good description / documentation for what this file really does, and why you are asking the problem described, for example, in this question (link) .

What does index.lockit actually do, and what causes the problem with this file in people?

It would be very nice to know, so I can prevent this problem in the future.

+4
source share
1 answer

https://www.kernel.org/pub/software/scm/git/docs/technical/api-lockfile.html. , .git/index.lock.

  • . , $GIT_DIR/index.lock, $GIT_DIR/index. $GIT_DIR/index.lock O_EXCL, , - else .
  • . , "lock", die(), , , . lockfiles atexit(3) . .

, , , . Git Linux , , .

+3

All Articles