导文
uniapp切换分支的时候 git报错
fatal: Unable to create ‘C:/Users/Administrator/Desktop/uniapp-food/.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.
问题描述
今天在切换分支的时候,突然发现切换不了,并且报了如下错误提示:
问题解决
(1)在 .git 同级目录中找到 index.lock ,删除就可以了。
(2)在 .git 同级目录执行 rm -f .git/index.lock 将文件删除就可以了。
会遇到项目git文件隐藏,或者公司屏蔽rm -f等方法
可以使用查找git上传记录
点击这里的路径就能找到文件直接删除就行。
您好,我是肥晨。
欢迎关注我获取前端学习资源,日常分享技术变革,生存法则;行业内幕,洞察先机。