Git rename from index.lock to index failed


Git rename from index.lock to index failed

In my case, this was caused by using the same Git repo from both admin and non-admin command prompts. When last git pull was from admin cmd, the index was created by it, and then non-admin cmd had insufficient permissions to modify it.

My solution was re-creating the index (while keeping the worktree intact):

del .git\index
git reset --mixed head

 

自己嘗試的方案

遇到的問題是,使用git status會報這個錯誤

因為git bash是直接安裝到環境變量的,用管理員權限打開powershell,然后在powershell里面執行git status就不會報錯了。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM