Couldn't find github in keychain MacOS
Asked Answered
K

6

17

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 ?!

Ken answered 23/8, 2021 at 7:33 Comment(0)
R
30

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.

Reminiscent answered 7/9, 2021 at 22:13 Comment(3)
Please provide additional details in your answer. As it's currently written, it's hard to understand your solution.Broadnax
I also faced same problem. Earlier I didn't check any scope while generated the access token. Then created a new one after checking all the scopes. It worked.Outshout
The problem with doing that is that so many times, even when you only select the minimum number of scopes, GitHub will tell you "Some of the scopes you’ve selected are included in other scopes. Only the minimum set of necessary scopes has been saved" which leaves you wondering what functionality is missing. I'd really like to hear an explanation of how that works.Sibert
R
2

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
Ruffled answered 23/8, 2021 at 8:8 Comment(8)
Sorry to nitpick but that second command line snippet was a duplicate of your first. I suspect the get on the end should be erase.Armada
@MartinPacker Good nitpicking, thank you :) I have edited the answer accordingly.Ruffled
@Ruffled Yes, git config credential.helper does return osxkeychain but entering git push show the error regarding aug 13th password change and asks to use token instead. Trying the first cmd line snippet to find cache, it returns zsh: command not found: git-credential-osxkeychain.Ken
@SaiKrishnadas Check out https://mcmap.net/q/25007/-github-for-mac-error-git-39-credential-osxkeychain-39-is-not-a-git-command/6309Ruffled
@Ruffled osxkeychain is returned but, fails to do git operations. Used to work when github used password for authenticationKen
@SaiKrishnadas Does git-credential-osxkeychain works now? If not, can you search for that file/executable on your disk?Ruffled
@Ruffled my bad! Actually git config credential.helper returns osxkeychain. I use git using terminal and not as an mac appKen
Let us continue this discussion in chat.Ruffled
N
2

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.

Natoshanatron answered 19/8, 2022 at 18:43 Comment(0)
S
1

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

Shaffer answered 6/11, 2021 at 19:18 Comment(0)
G
1

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.

Gestalt answered 6/7, 2022 at 1:58 Comment(0)
R
-1

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.

Redwing answered 16/11, 2021 at 8:45 Comment(1)
Thanks for contributing, but I don't think this answer really addresses the question, which is about a fairly specific macOS keychain problem.Cercus

© 2022 - 2024 — McMap. All rights reserved.