Visual Studio Git error: "The index is locked. This may be due to a simultaneous or crashing process."

Got an error in Git for Visual Studio:

The index is locked. This might be due to a concurrent or crashed process.

+4
source share
2 answers

Another process can still run in the background. In my case, I had a command (I always want to say DOS, lol) an invitation to open with the Git command, which stopped at Should I try again? (y/n), and I did not understand. He created the file index.lockin the folder .git, locking the file index(same folder) in the process. If this is not the case for you, open the task manager and find another Visual Studio process (devenv.exe) stuck in memory, or some other Git tool. If you do not see anything that could block it, you could simply try to delete the fileindex.lockdirectly (maybe turn off Visual Studio first). If it is not deleted, then another process is still blocked. You may need to reboot the system if you cannot find it, and make sure that the file is deleted during reboot (which you may have to do manually if the blocking process was interrupted by force).

+7
source

For me, resetting and deleting changes in my local branch did not help to solve the problem. I found a job around the "Index locked" problem. This works after you successfully make local changes to the remote repository.

  • Exit all the IDEs (including Visual Studio) that you are working on.

  • Then go to the .git folder in the project directory and delete the index.lock file

  • VS Team Explorer. - , "" "" ( "" ).

  • , reset, Reset .

  • .

  • 5 , "" "" ( "" ). , , . .

:)

+3

Source: https://habr.com/ru/post/1668991/


All Articles