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