A common cause is cloning using the default (HTTPS) instead of SSH. You can correct this by going to your repository, clicking “Clone or download”, then clicking the “Use SSH” button above the URL field and updating the URL of your origin remote like this:
git remote set-url origin git@github.com:username/repo.git
You can check if you have added the remote as HTTPS or SSH using:
git remote -v
This is documented at GitHub: Switching remote URLs from HTTPS to SSH.
Related Contents:
- Push branches to Git
- Is there a way to cache https credentials for pushing commits?
- Message “Support for password authentication was removed. Please use a personal access token instead.”
- Are Git forks actually Git clones?
- There is no tracking information for the current branch
- Remote origin already exists on ‘git push’ to a new repository
- Git Push ERROR: Repository not found
- Heroku: How to push different local Git branches to Heroku/master
- Can’t push to GitHub because of large file which I already deleted
- How do I avoid the specification of the username and password at every git push?
- Clone A Private Repository (Github)
- Meaning of the GitHub message: push declined due to email privacy restrictions
- How to pull remote branch from somebody else’s repo
- Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead [duplicate]
- Unable to Connect to GitHub.com For Cloning
- GitHub – fatal: could not read Username for ‘https://github.com’: No such file or directory
- How to clone all repos at once from GitHub?
- How do I fix “remote: fatal error in commit_refs” errors trying to push with Git?
- Trying to pull files from my Github repository: “refusing to merge unrelated histories”
- Issue pushing new code in Github
- ! [rejected] master -> master (fetch first)
- Git push hangs when pushing to Github?
- fatal: ‘origin’ does not appear to be a git repository
- Pushing a local branch up to GitHub
- Pushing from local repository to GitHub hosted remote
- Is there a way in git to obtain a push date for a given commit?
- How to unmerge a Git merge?
- git push heroku master says “Everything up-to-date”, but the app is not current
- How can I fetch an unmerged pull request for a branch I don’t own?
- How can I remove all files in my git repo and update/push from my local git repo?
- How to convert a readonly git clone from github to a forked one
- Github remote push pack size exceeded
- git@github.com: Permission denied (publickey)
- Git Pull vs. Pull Request
- git push rejected: error: failed to push some refs
- git push >> fatal: no configured push destination
- GitHub – error: failed to push some refs to ‘git@github.com:myrepo.git’
- Explain clones info in Github’s Traffic tab
- How to clone git repository from its zip
- Is it possible to find out the users who have checked out my project on GitHub?
- Why do some repository URLs end in .git while others don’t?
- How do I pull a missing file back into my branch?
- Elegant solution to prevent force push on master only
- How can I overwrite or replace a commit with new one once I have pushed to remote?
- How to push a single file in a subdirectory to Github (not master)
- Renaming a branch in GitHub
- How to remove file from Git history?
- How do you fork your own repository on GitHub?
- GitHub – List commits by author
- What exactly is a Release in GitHub?