'git-credential-osxkeychain wants to access key "github.com" in your keychain
In line with the github recently removing support for password authentication - I have created a PAT following this guide
However, everytime I git push
I see that that the "authencity of git-credential-osxkeychain cannot be verified.
Why this? Surely I don't need to enter my password everytime I push?
Solution 1:[1]
OSX prompts for a password every time you use git
after brew
upgrades git
. To make Keychain Access trust git
with the password again, you have to open Keychain Access, search for github under Keychain: login, kind: Internet password, and add the new path to git-credential-osxkeychain
. Or, just delete the github password and regenerate the Personal Access Token again. (source: Fixing the git-credential-osxkeychain password prompts on every git transaction
)
For example, today brew
installed git-credential-osxkeychain
to /usr/local/Cellar/git/2.36.0/libexec/git-core/git-credential-osxkeychain
, so I had to add that path to the password in Keychain Access.
$ brew info git
…
/usr/local/Cellar/git/2.36.0 (1,544 files, 43.6MB) *
…
$ find /usr/local/Cellar/git/2.36.0 -name git-credential-osxkeychain
/usr/local/Cellar/git/2.36.0/libexec/git-core/git-credential-osxkeychain
Solution 2:[2]
You can enter your password and click “Always Allow,” which should avoid you needing to enter the password again.
The likely reason for this is that your version of Git comes from Homebrew or another source that doesn't sign its packages, and Apple is complaining about this. As far as I'm aware, nobody but Apple ships a version of Git that's signed, and Homebrew is considered reputable, so there's no reason to be worried here. The notification is unnecessary.
Solution 3:[3]
https cloning has always been fraught with peril and you'll see issues like this .. additionally, Microsoft Corporation (who acquired GitHub in 2018) is attempting to frustrate you into using their command line tool by both hiding ssh clone and only appearing to offer clone via https or their command line tool
See Embrace, Extend, and Extinguish
Create ssh keys and clone via ssh instead of https
create a new key pair if you don't have one
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
clone the repo again using an ssh remote
git clone [email protected]:user/repo.git
or update the existing repo's remote to the ssh version
git remote -v # show existing remote git remote set-url [email protected]:user/repo.git
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | yonran |
Solution 2 | bk2204 |
Solution 3 |