用git Bush提交的時候遇到一個問題,不論做什么操作都遇到下面的錯誤信息
fatal: Unable to create 'XXXXXXXXX' : 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.
如何解決呢
按照'XXXXXXXXX'里面說的路徑找到該文件,刪除就可以了
如果沒有以上的提示
則把倉庫目錄里的.git/index.lock文件(文件是隱藏的)刪除就可以了。刪除index.lock不會影響Git使用。是說index文件被鎖住了,但是還有一個index文件要進行操作。
一個倉庫配有一個.git文件夾,在這個文件夾里面生成了一個index.lock文件,導致index文件不能被操作,所以把index.lock刪除就ok
在選擇的產庫目錄下找到.git