Can't add homebrew tap for runner: git@github.com Permission Denied

When trying to add the machine runner brew tap I get git@github.com: Permission denied (publickey). I’m not using ssh so I don’t understand why this would happen

% git clone https://github.com/circleci-public/homebrew-circleci
Cloning into 'homebrew-circleci'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

And

% brew tap circleci-public/circleci
==> Tapping circleci-public/circleci
Cloning into '/opt/homebrew/Library/Taps/circleci-public/homebrew-circleci'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Error: Failure while executing; `git clone https://github.com/circleci-public/homebrew-circleci /opt/homebrew/Library/Taps/circleci-public/homebrew-circleci --origin=origin --template= --config core.fsmonitor=false` exited with 128.
circleci@63459 ~ % git clone https://github.com/circleci-public/homebrew-circleci /opt/homebrew/Library/Taps/circleci-public/homebrew-circleci --origin=origin --template= --config core.fsmonitor=false
Cloning into '/opt/homebrew/Library/Taps/circleci-public/homebrew-circleci'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

The solution is that I had

[url "ssh://git@github.com"]
	insteadOf = https://github.com

In my .gitconfig, but I didn’t have a valid ssh key set up for github.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.