删除.git / index.lock':权限被拒绝 [英] remove .git/index.lock': Permission denied

查看:1742
本文介绍了删除.git / index.lock':权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我完全陷入了为什么我的git已经完全锁定了我。我有一台笔记本电脑,可以在工作时以及在家时使用。对于这两个帐户我广泛地使用git,并且都位于不同的路径。今天我开始工作,我什么也做不了,我看到的只是:

I'm completely stuck as to why my git has completely locked me out. I have a laptop that I use at work and when I'm home. For both accounts I use git extensively and both are located in different paths. Today I came into work and I can't do anything, all I see is:

/Applications/MAMP/htdocs/my_site/.git/index.lock': Permission denied

对于我所关心的分支,我在可以删除。我尝试删除分支,检出其他分支,删除index.lock文件(如网站上其他用户所建议的那样)。我只有终端窗口打开,没有其他可能的程序使用git(据我所知,在活动窗口中没有任何明显的)。我已经将计算机重新启动,直接进入我的工作帐户,但仍然没有运气。

For all I care the branch I'm on can be deleted. I've tried removing the branch, checking out any other branch, removing the index.lock file (as suggested by other users on sites). I only have the terminal window open, no other possible programs using git (as far as I know and nothing noticeable in the activity window). I have rebooted the computer straight into my work account and still no luck. How can I remove this lock?

推荐答案

检查哪个用户拥有git锁:

Check which user owns the git lock:

ls -la /Applications/MAMP/htdocs/my_site/.git/index.lock

然后,您可以使用 sudo 将其删除。

Then you can use sudo to remove it.

这篇关于删除.git / index.lock':权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆