執行git add .時,報錯git
fatal: Unable to create '/Users/lily/ForWork/forReBaomai/bm-fe/.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.this
大體意思是說:在/Users/lily/ForWork/forReBaomai/bm-fe/.git裏建立index.lock失敗:文件已存在。git的進程已經在一個編輯器中被打開。請確保全部的進程都結束,而後再次嘗試。若是仍然失敗,多是上個運行中的git崩潰,手動移除這個文件進程
解決方法:open /Users/lily/ForWork/forReBaomai/bm-fe/.git 打開.git文件夾,刪除該文件下的.git文件便可資源
或者 rm -f ./.git/index.lockrem
緣由:聽說是計算機對於進程的同步互斥管理,是有資源上鎖機制的。猜想這裏確定是有進程對某資源進行了加鎖,可是因爲進程忽然崩潰,將來得及解鎖,致使其餘進程訪問不了同步
查了半天只查到這麼一個緣由,全部文章都只有這麼一個解釋,暫時記着吧it