🌿GitHub authentication failed
git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.
GitHub turned you away, saying, "I can't confirm you're allowed to upload to this repository."
🤔 Why does it happen?
- GitHub no longer lets you upload with a password (you need a token or an SSH key)
- An SSH key wasn't created, or wasn't added to GitHub
- The repository address is wrong, or you don't have access (private repository)
🔧 Try this
- The easiest way is to use the GitHub login in GitHub Desktop or VS Code
- If you use the terminal, log in with gh auth login
- Check that the repository address is right with git remote -v
🤖 Ask your AI like this
I get the authentication error below when I git push. My computer is a [Mac/Windows]. Please walk me through the easiest way to set up GitHub login, step by step. [Paste the full error here]
Replace the [ ] parts with your own situation, and paste the error with a few extra lines before and after it.
Related terms
Other errors in this group
- Push rejected
failed to push some refs (rejected) - Merge conflict
CONFLICT (content): Merge conflict - Not a git repository
fatal: not a git repository - Can't combine two different histories
fatal: refusing to merge unrelated histories - File too big to upload to GitHub
File exceeds GitHub's file size limit of 100.00 MB - Push blocked because it contains a secret key
Push cannot contain secrets (GH013)