onkar
onkar

Reputation: 4547

Cloning Git Repositroy using ssh

I am trying to clone a git repository on Mac via ssh. Steps I have followed so far

  1. Created id_rsa.pub and shared it with the Admin for access.The file is located at /Users/admin/.ssh
  2. Created a config file at /Users/admin/.ssh. The file content is

    Host MY_DOMAIN
        IdentityFile ~/.ssh/id_rsa
        IdentitiesOnly yes
    
  3. I am running the following command on terminal

    git clone git@MY_DOMAIN:android.git     
    git clone git@MY_DOMAIN:android
    

and the response I am getting is

Cloning into 'android'...
Enter passphrase for key '/Users/admin/.ssh/id_rsa': 
Connection to MY_DOMAIN closed by remote host.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I am bit confused on, if I am following the right approach or is there any issue with access rights.

Upvotes: 2

Views: 202

Answers (1)

hjpotter92
hjpotter92

Reputation: 80629

The first 2 steps should be followed for your own user account, and not for /Users/admin.


Based on your recent edit, it appears that the issue is not with git configuration, but with your gitolite setup. Currently, your gitolite instance is allowing you access to only one repository, namely testing as is clear from the following output:

hello onkar, this is git@m running gitolite3 v3.6.2-12-g1c61d57 on git 2.1.4

 R W    testing

Configure your gitolite-admin repo and allow access to the android project as well.

Upvotes: 1

Related Questions