After I changed password for my bitbucket account, I can't seem to push anything to the repository. I can pull, add, commit but not push.
I used to clone using https and whenever I push, it would say
Remote: unauthorized Fatal: Authentication failed for url.
I search for this on google and stack overflow for 2 days, none of the solution worked.
So I decided to try SSH. I follow instruction to generate an SSH-Key and add it to bitbucket.
However as soon as I push it gave me:
repository access denied.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists."
Any idea on what to do?
Regarding https, double-check if you have a credential helper which would have cached your credentials:
git config credential.helper
As explained in " How to sign out in Git Bash console in Windows? ", this would remove the credentials:
git credential-manager delete https://bitbucket.org
Regarding ssh, double-check your key is proposed with:
set GIT_SSH_COMMAND="ssh -v"
git push
I'm going to take a wild guess: you're on macOS version 10.12 or later, right?
Apple changed the behavior of ssh-agent as of Sierra so that it no longer adds keys automatically. You can change this in one of several ways:
ssh-add -A
to your .rc file (usually .bashrc, sometimes something else). This will add identities from your keychain to the ssh-agent. (You can add identities to the keychain with ssh-add -K
.) Host bitbucket.org IdentityFile /path/to/private/key AddKeysToAgent yes
(The SSH config file is a powerful tool, but different systems may have different options. Read man ssh_config
to see which options you have available on a given system.)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.