I'm using the latest Github for Mac as a new Git user. When I try to sync a repo (that I first cloned, then created a new branch, commited changes, and then merged with master), I got the error:
Authentication Failed. You may not have permission to access repo111. Check Preferences to make sure you’re still logged in.
I searched for similar questions, but the answer seemed to be add SSH keys to github, so I followed: https://help.github.com/articles/generating-ssh-keys.
When I do ssh -T [email protected]
, I get:
Hi User111! You've successfully authenticated, but GitHub does not provide shell access.
I'm logged in as the correct user, and have rights to the repo, so I'm not sure why I'm not authenticated?
Always use the "git" user$ ssh -T [email protected] > Permission denied (publickey). If your connection failed and you're using a remote URL with your GitHub username, you can change the remote URL to use the "git" user. You should verify your connection by typing: $ ssh -T [email protected] > Hi username!
Change file permissions Type this command followed by a space: chmod 755. Drag the file or folder onto the Terminal window. Press Return. Permissions for the file or folder will be changed to read, write, and execute.
You can install GitHub Desktop on supported Windows or macOS operating systems.
It could be that you entered a password incorrectly and it's stored in your keychain.
For my situation, I was using GitHub for Mac to work with a BitBucket repository. Long story short, I mistyped my BitBucket password and GitHub for Mac could not authenticate (because the password stored in my keychain was wrong).
Thanks to the helpful folks at GitHub, they quickly responded when I asked for help:
Open
Keychain Access.app
(in/Applications/Utilities
) and search for "GitHub for Mac." There should be an entry like "GitHub for Mac — bitbucket.com". Delete that entry
If you see this:
… then you might have a BitBucket keychain/password problem.
Open Keychain Access.app
(in /Applications/Utilities
) and search for bitbucket
:
Right-click on the entry and get info:
Click on "Access Control" to confirm that it's truly the GitHub for Mac BitBucket password/login keychain item:
Rather than deleting the keychain entry/item, I just edited my password:
You should now be able to use GitHub for Mac without authentication failures. :)
Had the same problem, but it was not a password problem, since other repositories worked just fine.
Finally compared .git/config
with a working repository and found this:
This failed:
[remote "origin"] url = [email protected]/path/to/repository
This worked:
[remote "origin"] url = https://github.com/path/to/repository
Still have no idea how or why this changed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With