1. 程式人生 > >使用git add命令時遇到 fatal: Unable to create index.lock File exists 錯誤的解決辦法

使用git add命令時遇到 fatal: Unable to create index.lock File exists 錯誤的解決辦法

$ git add .
fatal: Unable to create 'D:/Git/ocr/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.

解決辦法:

進入對應專案的.git目錄將index.lock檔案刪除 再重新新增