Git: Permission denied (publickey) fatal - Could not read from remote repository. while cloning Git repository

后端 未结 30 1982
青春惊慌失措
青春惊慌失措 2020-12-12 10:10

I am unable to clone a Git repository, and getting this error:

krishna.soni@KRISHNACHANDRAS /c/Projects $ git clone http://stage.abc.com:10088/pqr
http://<         


        
30条回答
  •  -上瘾入骨i
    2020-12-12 10:54

    In macOS / Linux (Ubuntu):

    1. To Authenticate you need to add your public part of your SSH key pair to bitbucket from within your user settings: User Settings --> SSH keys

    You will find the said public part in your ~/.ssh directory, usually id_rsa.pub . note the .pub part of the file name for Public. it will help you to generate one if you don't already have one

    You are not done yet ...

    2. You need to let your system know what key to use with which remote host, so add these lines to your ~/.ssh/config file

    Host bitbucket.org
     IdentityFile ~/.ssh/PRIVATE_KEY_FILE_NAME
    

    Where PRIVATE_KEY_FILE_NAME is the name of private part of your SSH key pair, if you haven't messed with it, usually its default name is : id_rsa in this case replace PRIVATE_KEY_FILE_NAME above with id_rsa(the private key DOES NOT have a .pub extension)

提交回复
热议问题