Git: fatal: Unable to create 'xxx/.git/index.lock': File exists.

"D:\Program Files\Git\bin\git.exe" checkout -b "gyn_xxx" "34e90a68"
fatal: Unable to create 'D:/xxx/xxx/.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.
Done

Press Enter or Esc to close console...

從倉庫里clone了一個(gè)老的項(xiàng)目下來,新建分支和checkout都報(bào)這個(gè)錯(cuò),
百度,google了發(fā)現(xiàn)都是叫刪除 index.lock文件的和重啟電腦,試了下還是不行,

最終在http://stackoverflow.com/questions/7860751/git-fatal-unable-to-create-path-my-project-git-index-lock-file-exists
這里找到了一種可行的方式:

就是設(shè)置文件的權(quán)限

Paste_Image.png

將項(xiàng)目的權(quán)限設(shè)為everyone可以全部操作,重新checkout后可行了。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容