1

I'm trying to install OpenJdk 8 on a MacOS recently updated to Mojave. 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'.

I looked at the hidden .git directories under/Homebrew. 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.

user26270
  • 6,904
  • 13
  • 62
  • 94

1 Answers1

1

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. The actual problem is 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?

torek
  • 448,244
  • 59
  • 642
  • 775