【问题标题】:error of "could not lock config file .git/config: Permission denied" due to unstaged changes; in Homebrew while installing openJDK 8由于未暂存的更改,出现“无法锁定配置文件 .git/config:权限被拒绝”的错误;在 Homebrew 中安装 openJDK 8
【发布时间】:2019-01-29 17:20:06
【问题描述】:

我正在尝试在最近更新为 Mojave 的 MacOS 上安装 OpenJdk 8。安装命令是

brew tap AdoptOpenJDK/openjdk

这会导致以下错误:

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.

但是当我在 /usr/local/Homebrew 目录中执行“git status”时,它会显示“没有什么可以提交,工作树清理”。

我查看了/Homebrew 下隐藏的 .git 目录。就在昨天之前,它已经一年没碰过了。我一般不会弄乱它,也有一段时间没有用它来安装任何东西了。

【问题讨论】:

    标签: java git macos homebrew


    【解决方案1】:

    cannot rebase 是一条红鲱鱼——Git 被早期的失败弄糊涂了,认为它需要围绕它重新定位,但早期的失败并不是因为更改。实际问题是permission denied

    那个问题正是它所说的。作为您自己,您无权修改这些文件。这意味着您要么撤销了自己的权限,要么以其他用户的身份制作了这些文件。见How to fix homebrew permissions?

    【讨论】:

      猜你喜欢
      • 2018-08-23
      • 2015-11-12
      • 1970-01-01
      • 2011-05-20
      • 1970-01-01
      • 2017-12-02
      • 2017-11-14
      • 2021-07-23
      相关资源
      最近更新 更多