After successfully cloning my repo from heroku and added another remote
1/ git clone git@heroku.com:[APP].git
2/ git remote add bitbucket ssh://git@bitbucket
Two step process to be able to push pull
Step1: Generate ssh key(public and private) on mac
Step2: Put private key in mac and public key in git website
below detailed steps are for mac users
Step 1: Generating keys
ssh-keygen
this will prompt you to enter storage location for key, you may type /Users/[machinename]/.ssh/[keyname]
Step2:pushing keys to appropriate locations[mac and remote accounts i.e Github, bitbucket, gitlab etc ]
ssh-add -K ~/.ssh/[keyname]
in terminal to add your private key to the macpbcopy < ~/.ssh/[keyname].pub
to copy public key to clipboardDone, now you can push pull.
I had this happen when I was trying to use a deployment key because that is exactly what I wanted.
I could connect via ssh -T git@bitbucket.org
and it would tell me I had access to read the repository I wanted, but git clone
would fail.
Clearing out ~/.ssh/known_hosts
, generating a new key via ssh-keygen
, adding that new key to bitbucket, and retrying fixed it for me.
'Deployment Key' is only for Read Only access. Following is a good way to work through this.
TLDR: ssh-add ~/.ssh/yourkey
I've just worked through this problem.
And none of the other answers helped.
I did have a ./ssh/config with all the right stuff, also an earlier repository working fine (same bitbucket account, same key). Then I generated a deploy_key, and after that created a new repository.
After that could not clone the new repo.
I wish I knew how/why ssh agent was messing this up, but adding the key solved it. I mean adding the key in my local Ubuntu, not in bitbucket admin. The command is just
~/.ssh$ ssh-add myregualrkey
Hope this helps someone.
You have to delete the deployment key first if you are going to add the same key under Manage Account SSH Key.
for this error : conq: repository access denied. access via a deployment key is read-only.
I change the name of my key, example
cd /home/try/.ssh/
mv try id_rsa
mv try.pub id_rsa.pub
I work on my own key on bitbucket