webstorm 轉vscode Git操作 fatal: Unable to create index.lock File exists

一、問題描述

使用git commit 命令提交代碼,遇到下面的錯誤:

fatal: Unable to create 'XXXXXX/.git/index.lock': File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.

二、解決辦法

在項目根目錄下找到 .git 文件夾。打開該文件夾。找到文件夾裏面的index.lock 文件,將其刪除,即可解決問題。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章