Repository access denied. access via a deployment key is read-only

前端 未结 18 2040
孤城傲影
孤城傲影 2020-11-29 15:49

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         


        
18条回答
  •  长情又很酷
    2020-11-29 16:10

    Steps:

    1. Create ssh keys on source server

      ssh-keygen

    2. Cat and copy id_rsa.pub located under ~./ssh directory

    3. Go to Bitbucket, if you have already set the access keys for repository(s) then delete existing public key(s)
    4. Go to Bitbucket avatar> Bitbucket settings> SSH Keys (under Security, left pane)> Click on 'Add Keys'> paste the public key.
    5. Check if it works by running below command on the source server

      git remote show origin

    6. For fetch and push from the source server, if the protocol is 'https' then you have to change it to 'git+ssh' by running below command

      git remote set-url origin git+ssh://@bitbucket.org//repo.git

    7. Check if you can do push to the repo.

    Done!

提交回复
热议问题