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

前端 未结 18 2031
孤城傲影
孤城傲影 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:17

    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

    1. (make sure you have git installed)https://git-scm.com/download/mac
    2. open terminal and type ssh-keygen this will prompt you to enter storage location for key, you may type /Users/[machinename]/.ssh/[keyname]
    3. Next it will ask for passphrase, you can either leave it blank by pressing enter or enter some keyword to be entered again at next prompt
    4. This will have created two keys for you, private and public, with name [keyname] and [keyname].pub

    Step2:pushing keys to appropriate locations[mac and remote accounts i.e Github, bitbucket, gitlab etc ]

    1. Type ssh-add -K ~/.ssh/[keyname] in terminal to add your private key to the mac
    2. Type pbcopy < ~/.ssh/[keyname].pub to copy public key to clipboard
    3. Open account settings on your respective git website and go to add key, there paste the public key copied above

    Done, now you can push pull.

提交回复
热议问题