简体   繁体   English

错误的错误消息“无法锁定配置文件.git / config:权限被拒绝”,原因是未进行分阶段的更改; 在安装openJDK 8时在Homebrew中

[英]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.

相关问题 Eclipse 中的未暂存更改,但 git 中没有更改 - Unstaged changes in Eclipse, but no changes in git 使用 Homebrew 为 Mac 安装 OpenJDK 8 (subversion 1.8.0.119)? - Installing OpenJDK 8 (subversion 1.8.0.119) for Mac using Homebrew? 加载配置文件形式文件系统时,Spring无法解析占位符 - Spring Could not resolve placeholder while loading config file form filesystem Java部署,配置文件更改 - Java Deployment, Config File Changes 在Mac中由application(.jar)读取/写入文件时权限被拒绝错误 - permission denied error while reading/writing file by application(.jar) in mac 使用 HomeBrew 安装 Java OpenJDK:为什么在不同的位置有相同版本的 java? - Installing Java OpenJDK with HomeBrew: why there are same versions of java on different locations? 权限被拒绝导致“安装因APK文件无效而失败” - Permission denied causing “Installation failed due to invalid APK file” 访问文件 Android 11 时权限被拒绝 - Permission denied while accessing file Android 11 编写TokenizerMapper权限时Hadoop“出错” - Hadoop “error while writing TokenizerMapper permission denied” 运行 maven 安装时权限被拒绝错误 - Permission denied error while running maven install
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM