git add 錯誤,git add不了文件

git 錯誤

git命令行模式,輸入git add 命令出現以下錯誤

fatal: Unable to create ‘C:/Users/cp/Documents/GitHub/first/.git/index.lock’: File exists.git

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.github

如圖爲sourceTree查看倉庫

HEAD,指到當前個人遠程github learngit倉庫的master分支,如圖想git add 當前的更改(對應圖中未提交的更改),git add出現如上錯誤。markdown

提示存在 index.lock 文件,進入C:/Users/cp/Documents/GitHub/first/.git,刪除掉index.lock文件,便可解決this

這裏寫圖片描述

相關文章
相關標籤/搜索