GitHub 'Permission Denied' or 403 When Pushing Over HTTPS
Quick answer
A 403 or 'Repository not found' on push usually means Git is using the wrong account or a token without write access. Fix the cached identity, give the token write access to the repo, and authorize SSO if the org requires it.
Most likely fix: Check which account Git is using
How to fix it
Try these in order — the most common fix is first.
1. Check which account Git is using
- Run git remote -v to confirm the URL
- Remove the cached credential in Keychain Access (macOS) or Credential Manager (Windows)
- Push again and sign in with the right account
Did this fix it?2. Fix the token permissions
- Classic token: enable the repo scope
- Fine-grained token: select the repository and set Contents to Read and write
- Authorize the token for SSO under Configure SSO if the org uses it
Did this fix it?3. Confirm you have write access
- Open the repository > Settings > Collaborators, or ask an owner
- If you only have read access, fork the repo and open a pull request
Did this fix it?4. Use GitHub CLI to sign in cleanly
- Run gh auth login and gh auth status
- Run gh auth setup-git so Git uses its credentials
Did this fix it?
Symptoms
git push shows 'remote: Permission to OWNER/REPO.git denied to USER', 'The requested URL returned error: 403', or 'remote: Repository not found' for a repo you can open in the browser.
Why it happens
- Git is using a cached credential for a different GitHub account
- The personal access token lacks the repo scope or Contents write permission, or is not granted that repository
- The organization requires SAML SSO and the token is not authorized
- You only have read access to the repository
- The remote URL has a typo or the repository was renamed or moved (private repos return 'not found' instead of 403)
This guide also covers
- remote permission denied to github 403
- github repository not found but exists
- the requested url returned error 403 github
- fatal unable to access github 403
Still not working?
If GitHub keeps failing, you're not alone. See every GitHub problem users report or the alternatives people switch to.
Need a custom web app or internal tool? Our small team builds it, on your domain or hosted by us. Price agreed together.
Get a quoteOther GitHub errors
- GitHub Permission Denied (publickey) Error
- GitHub 'Password Authentication Was Removed' Error
- GitHub Push Rejected: Updates Were Rejected (Non-Fast-Forward)
- GitHub Push Blocked: Repository Rule Violations (GH013 / Secret Detected)
- GitHub Push Rejected: File Exceeds 100 MB Limit
- GitHub Locked Out: Lost 2FA Device or Recovery Codes
- GitHub Actions Workflow Stuck in Queued / Waiting for a Runner
- GitHub Actions: 'Recent Account Payments Have Failed or Spending Limit Needs to Be Increased'