Brew update requires keychain password every time due to my git config

Hi folks, brew update brings up this “git-credential-osxkeychain wants to access key github.com in your keychain” prompt once in a macOS user session (or after lock/unlocks).

image

My git config contains these configs as I want to use SSH for https:// remotes on github for my own repos:

credential.helper=osxkeychain
url.git@github.com:.pushinsteadof=https://github.com/

Similarly my .ssh/config has this:

Host github.com *.github.com
	HostName github.com
	User git
	IdentityFile ~/.ssh/github_rsa
	UseKeychain yes

Any ideas how to make this prompt not show, for brew [update|install]?

Can you modify the pushinsteadof line to include the owner of the private repos you want to access?

url.git@github.com:owner/.pushinsteadof=https://github.com/owner/

I haven’t tested it, but I’m curious if it will work.

This prompt isn’t to access GitHub over HTTPS but instead to get your token to use for GitHub API calls.

Correct, but how do you get this to stop? Is it necessary?