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:
- Asking git to look for different key other than id_rsa
- How to use git with ssh on github https repository addresses?
- How to fix a error “Permission denied” when trying to push to a live server?
- JGit with ssh key in non-default location
- How to disable SSH in GitBash and use HTTPS instead
- fatal: 'jigar/test.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly
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 188.8.131.52 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.
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!