Couldn't find github in keychain MacOS

Viewed 12608

August 13th, github no longer accepts password for git actions. So, to update the token, I would have to change the password field in the keychain (github keychain) to token as recommend. But, Unfortunately I couldn't find my keychain related to github.

enter image description here

Where can I find the keychain for github, and edit it so that git actions works ?!

6 Answers

Have you tried to put your token as password for git action? When git asked for the password, just put your token as password.

If you have never logged in to GitHub yet, then you will not find GitHub in the keychain. Make sure when you generate token you checked all the scopes you need.

Assuming git config credential.helper does return osxkeychain, not finding github.com in it means: the helper is ready to cache your new credentials.
A new git push should display a prompt where you would enter your GitHub user account name, and your PAT (Personal Access Token).

Check first nothing was cached with:

printf "protocol=https\nhost=github.com"| git-credential-osxkeychain get

If it was, you could remmove it with the erase command:

printf "protocol=https\nhost=github.com"| git-credential-osxkeychain erase

I had the same problem and i solved that by connecting my github account via fork. it will help you to solve this problem.

First, you need to generate your PAT on GitHub.

Then go back to your terminal: run a git command, input your GitHub username and use your token in place of your password.

Just open KeyChain Access, then create a new entry >Passwords> click on the notepad symbol on the top right> in the keychain item name enter the url > then enter the username of the repo > copy the token into the password section.

You can download github desktop - https://desktop.github.com/ You can signin with your github credentials and you can clone and push/pull your code.

Related