[英]error of “could not lock config file .git/config: Permission denied” due to unstaged changes; in Homebrew while installing openJDK 8
I'm trying to install OpenJdk 8 on a MacOS recently updated to Mojave. 我正在尝试在最近更新为Mojave的MacOS上安装OpenJdk 8。 The install command was
安装命令是
brew tap AdoptOpenJDK/openjdk
It results in the following error: 它导致以下错误:
touch: /usr/local/Homebrew/.git/FETCH_HEAD: Permission denied
fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': Permission denied
error: could not lock config file .git/config: Permission denied
Cannot rebase: You have unstaged changes.
Please commit or stash them.
But when I do 'git status' from within the /usr/local/Homebrew directory, it says 'nothing to commit, working tree clean'. 但是,当我从/ usr / local / Homebrew目录中执行“ git status”时,它说“什么也没提交,工作正常”。
I looked at the hidden .git directories under/Homebrew. 我查看了/ Homebrew下隐藏的.git目录。 Before yesterday, it hadn't been touched in a year.
昨天之前,一年没有被触及。 I don't generally mess with it and haven't used it to install anything in awhile.
我一般不会弄乱它,也不会在一段时间内使用它来安装任何东西。
The cannot rebase
is a red herring—Git's gotten confused by the earlier failure into thinking it needs to rebase around it, but the earlier failure is not because of changes . cannot rebase
是一个红鲱鱼-早期失败使Git感到困惑,认为它需要重新建立基础,但是早期失败并不是因为变化 。 The actual problem is permission denied
. 实际的问题是
permission denied
。
That problem means exactly what it says. 这个问题就是它所说的。 You, as yourself, have no permission to modify these files.
您和您自己一样,无权修改这些文件。 That means either you revoked your own permission, or you made these file as some other user.
这意味着您要么撤销自己的许可,要么以其他用户的身份创建这些文件。 See How to fix homebrew permissions?
请参阅如何修复自制程序权限?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.