Git SVN 错误: 之前存储库中的一个 Git 进程崩溃了

我只是想对 Git 管理器进行更改。据我所知,这个想法似乎是要删除锁文件。这条信息说:

确保没有其他 Git 进程正在运行,并手动删除该文件

也许有人知道,哪个文件要删除,如何删除?

98900 次浏览

The file in question is likely .git/index.lock and it should be safe to just remove it if you have no other git processes running. Make sure a git-svn command isn't hanging.

PS My usual approach to fixing git-svn problems is to make a fresh pull of the repository. Time consuming, but you can do it in parallel with trying to fix the problem. Have a little race between you and git. Of course, this only works if you didn't have unpushed commits.

For "GUI" user like me

Open Git Extension and choose repository (if more than one) Choose "Settings" from top menu then "Git Maintenance" and then click on "Delete Index Lock"

Git Extensions: Settings->Git Maintenance->Delete Index Lock

Removing the index.lock file like Schwern stated will solve this problem.

You can remove it by running rm -f ./.git/index.lock

The rm command is used to remove (delete) files and directories.

The -f stands for force which tells your computer to remove the files without prompting for confirmation

You have already opened a commit in another tab in the terminal

It may also concern any *.lock files in .git/

Check and remove them. You may use: rm -f ./.git/*.lock

The answer giving by @Joel helped, except that for windows users you may have to enable show hidden files/folders to access .git folder where index.lock file exist. Use this link in case you don't know how to enable hidden folders.

Removing the index.lock file like Schwern stated will solve this problem.

You can remove it by running rm -f ./.git/index.lock

The rm command is used to remove (delete) files and directories.

The -f stands for force which tells your computer to remove the files without prompting for confirmation

still not working means open the git through git bash instead of doing in terminal

I solve this error by just following steps:-

  1. Go in your same directory in which your project exist.
  2. Unhide Hidden files (for ubntu press ctrl+ H)
  3. Move inside .git directory
  4. Remove "index.lock" file

It solve this Problem

I was facing the issue, and I couldn’t even able to find the index.lock. My environment was a little bit different, a cluster with multiple nodes. The issue was encountered in the master node, and I solve it just by jumping to the worker node since the master node is chaired by all connected user