1

I created a gitolite repo in my ubuntu server following the steps mentioned in the below link.

http://www.bigfastblog.com/gitolite-installation-step-by-step

From my ubuntu client, I was able to clone the repo, by giving necessary information in ~/.ssh/conf

In windows I again created .ssh/conf similar to ubuntu, .ssh/conf is as shown below:

 Host gitbox
 User gitolite
 Hostname 10.47.52.185
 Port 22
 IdentityFile C:\Users\AY\.ssh\anish

Now when I try to clone, it is giving me below error:

 git clone gitbox:gitolite-admin
 Cloning into 'gitolite-admin'...
 ssh: Could not resolve hostname gitbox: no address associated with name
 fatal: Could not read from remote repository.

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

I guess .ssh/conf doesn't have any effect.
How can I clone a gitolite repo in windows?

anikhan
  • 1,147
  • 3
  • 18
  • 44

1 Answers1

2

Simple: when given an alias, ssh will look for %HOME%/.ssg/config.

As in "config", not "conf".

Make sure HOME is defined (to C:\Users\AY). And that your ssh config file is named "config".

Also test if ssh -i C:\Users\AY\.ssh\anish -T gitolite@10.47.52.185 does work.

In addition, the OP anish mentions in the comments:

I have used the gitolite.pub from ubuntu, I created anish.pub in windows and added this to gitolite and changed conf/gitolite.conf as shown below repo

gitolite-admin RW+ = gitolite 
repo testing 
  RW+ = @all 
repo bigfastblog 
  RW+ = anish 

Make sure to push that gitolite.conf back to the Ubuntu server, and check that ~gitolite/.ssh/authorized_keys does list anish.pub content.
Also Windows HOME/.ssh should include anish.pub and anish (the private key)

The OP anish confirms in the comments:

Finally able to clone: It is problem with HOME environment variable.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @anish are you on Mac? I thought you were on Windows? What HOME is set to? – VonC Nov 18 '15 at 05:42
  • Hi Vonc, I created gitolite on ubuntu server and trying to do git clone to this server from windows – anikhan Nov 18 '15 at 05:43
  • @anish Then why your ssh (on Windows) is trying to modify `/home/ayl5kor/.ssh/known_hosts`? This is not a Windows path. – VonC Nov 18 '15 at 05:44
  • Sorry i have used the gitolite.pub from ubuntu, I created anish.pub in windows and added this to gitolite and changed conf/gitolite.conf as shown below repo gitolite-admin RW+ = gitolite repo testing RW+ = @all repo bigfastblog RW+ = anish Now how can i access this from windows – anikhan Nov 18 '15 at 05:54
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/95405/discussion-between-anish-and-vonc). – anikhan Nov 18 '15 at 06:01
  • Hi VonC, after adding above data in gitolite.conf i have done git clone on my windows pc using git clone gitolite@10.47.52.185:bigfastblog.git which is asking for a password, which i have not set – anikhan Nov 18 '15 at 06:03
  • ya it is showing anish in authorized keys gitolite start command="/home/gitolite/bin/gitolite-shell anish" – anikhan Nov 18 '15 at 06:12
  • @anish That is expected. I'll get back to you in one hour: I have to commute to work first. – VonC Nov 18 '15 at 06:12
  • @anish And... back. Chat is blocked at work, so here is my comment. From Windows, you need to use `%HOME%\.ssh\config` file, and test the url gitbox: `ssh -T gitbox`: it will be translated into `ssh -T -i C:\Users\AYL5KOR\.ssh\anish -T gitolite@10.47.52.185`, which will use the public `anish.pub` and private `anish` ssh keys. – VonC Nov 18 '15 at 07:05
  • @anish If that is still not working, try also, as in http://stackoverflow.com/a/32778189/6309, a unix-style path for the `IdentityFile` field: `/C/Users/AYL5KOR/.ssh/anish` in your `.ssh/config` file on Windows. – VonC Nov 18 '15 at 07:09
  • Hi Vonc, Finally able to clone, It is problem with HOME enviroment variable. – anikhan Nov 19 '15 at 04:06
  • @anish Great! I have included your comment in the answer for more visibility. Could you consider http://stackoverflow.com/help/accepted-answer? – VonC Nov 19 '15 at 05:07