關於Git的錯誤

寫完代碼以後,不能繼續提交,錯誤顯示是這樣的。

fatal: Unable to create '/Users/Demo/.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.

大致意思是,有個其他進程在操作這個倉庫,所以無法繼續提交。

只需要刪除index.lock文件即可。

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