Cannot login into gitolite server to clone, but can connect via ssh

While there are several questions with similar symptoms, none are exactly the same, nor do the solutions presented there solve my issue.

I have set up gitolite successfully, as far as I am aware, using these instructions, and after overcoming this issue. The host user is git, and I have set up the following .ssh/config file on my workstation:

Host admin
    Hostname server.com
    User git
    IdentityFile ~/.ssh/admin


Host dev
    Hostname server.com
    User git
    IdentityFile ~/.ssh/micha

I can ssh using the admin config with ssh admin and get the following response:

stdin: is not a tty
hello admin, this is git@hostname running gitolite3 v3.5.1-2-g962e465 on git 1.7.10.2

 R W    gitolite-admin
 R W    testing
Connection to xxx.xxx.xxx.xxx closed.

Whenever I try to clone the gitolite-admin repo, however I get the following response:

Cloning into 'gitolite-admin'...
fatal: Could not read from remote repository.

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

According to the previous ssh response, I do have access rights. I have also verified that the git user is owner of the repository files on the server. After researching this, I have changed local GIT_SSH from TortoisePlink.exe to C:\Program Files (x86)\Git\bin\ssh.exe and still get the same response. All the following variations of the clone command elicit the same response:

  • ‘git clone admin:gitolite-admin’
  • ‘git clone admin:gitolite-admin.git’
  • ‘git clone admin:repositories/gitolite-admin’
  • ‘git clone admin:~/repositories/gitolite-admin’
  • ‘git clone ssh://admin:gitolite-admin’
  • ‘git clone git@admin:gitolite-admin’
  • all sorts of permutations of the above variations.

I am now at a loss as to how to overcome this problem.

  • php run git got “ssh Permission denied”
  • Git - how to deal with same repository but different protocol (http and ssh)
  • Jenkins Git ssh setup does not let me use username/password
  • shell_exec('which git') returns empty string on Godaddy shared hosting server
  • How to install Lambda function on AWS?
  • Git clone private repo, permission denied
  • error when cloning git repository with ssh
  • Bitbucket git push ssh “conq: invalid repository syntax.”
  • One Solution collect form web for “Cannot login into gitolite server to clone, but can connect via ssh”

    It turns out I HAD fixed the problem, I just needed to close the git-bash and restart it. Changing the GIT_SSH variable from TortoisePlink to C:\Program Files (x86)\Git\bin\ssh.exe as shown in this answer was what was needed.

    Naively perhaps, I thought the variable would be parsed each time the git clone command was used, but once I restarted the git-bash, the git clone command worked!

    Git Baby is a git and github fan, let's start git clone.