Hi, I'm able to git-clone a tree using ssh: [root@kd001 t]# git-clone ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ erez.zilber@kites's password: remote: Counting objects: 9, done. remote: Compressing objects: 100% (5/5), done. remote: Total 9 (delta 0), reused 0 (delta 0) Receiving objects: 100% (9/9), done. However, it doesn't work with http/https/git: [root@kd001 t]# git-clone http://kites/pub/git/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ Cannot get remote repository information. Perhaps git-update-server-info needs to be run there? [root@kd001 t]# git-clone https://kites/pub/git/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ Cannot get remote repository information. Perhaps git-update-server-info needs to be run there? [root@kd001 t]# git-clone git://kites/pub/git/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ kites[0: 172.16.1.11]: errno=Connection refused fatal: unable to connect a socket (Connection refused) fetch-pack from 'git://kites/pub/git/erez.zilber/my_test.git' failed. What's the problem? Thanks, Erez --
Maybe you should run git-update-server-info in the repository on the Maybe you should run git-update-server-info in the repository on the server? By the way, try enabling the post-update hook -- it runs update-server-info for you automatically after pushing to your server Is the git daemon running on your server? You need to configure inetd or git-daemon yourself, that is not done automatically for you. -- http://spinlock.ch/blog/ --
Forgot to mention - I tried to run git-update-server-info from the repository on the server. I got the same results. BTW - if it works OK with ssh, I can only guess that git-update-server-info won't help for Make it executable on the client side before pushing (i.e. in I ran git-daemon on the server side like this: sudo git-daemon --base-path=/pub/git/ --export-all --listen=kites Erez
Hi, No, you did not. Otherwise, the message would not appear. It can be that you have _another_ repository on the server, but running Wrong again. ssh transport is special, and does not need the information update-server-info provides. Hth, Dscho --
On Tue, Jun 24, 2008 at 2:48 PM, Johannes Schindelin Thanks for the quick answer. I'm sure that something _is_ wrong. Otherwise, everything should have worked already. I think that I'm using the right repository for git-clone because it's the same path that I used for git push: [root@kd001 my_test.git]# git-push --all ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git erez.zilber@kites's password: Counting objects: 9, done. Compressing objects: 100% (5/5), done. Writing objects: 100% (9/9), 740 bytes, done. Total 9 (delta 0), reused 0 (delta 0) To ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git * [new branch] master -> master Now, on the server side: -sh-3.1$ cd my_test.git/ -sh-3.1$ ls info/ exclude -sh-3.1$ git-update-server-info -sh-3.1$ ls info/ exclude refs looks like git-update-server-info did some work (added the refs file). Back to the client: [root@kd001 t]# git-clone http://kites/pub/git/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ Cannot get remote repository information. Perhaps git-update-server-info needs to be run there? The path is the same path that was used for pushing the repository. What did I miss here? Thanks, Erez --
First, obvious question: do you have web server enabled? Second, less obvious: how this server maps pathname information from URL into path in the filesystem? -- Jakub Narebski Poland ShadeHawk on #git --
I guess that the problem is that no proper mapping exists. That's why I see the following in /var/log/httpd/error_log: [Tue Jun 24 16:31:52 2008] [error] [client 172.16.0.7] File does not exist: /var/www/html/pub What do I need to add in /etc/httpd/conf.d/ in order to set the mapping to /pub/git instead of /var/www/html/pub ? Is there an example that shows how to map? Thanks, Erez --
IMO the simplest way is to create a symlink 'pub' in /var/www/html directory pointing to /pub and to add 'Options FollowSymLinks' to <Directory /> in httpd.conf. -- Best regards, Anton mailto:agladkov@parallels.com --
To be able to use the HTTP git transport? No. If you use the HTTP transport to clone a repository, gitweb is not used in any way. -- http://spinlock.ch/blog/ --
Adding the symlink solved the cloning with http problem. Thanks, Erez --
Another solution (not necessary simplest, but it might be preferred from the security point of view) is to do some URL rewriting / redirection. See your web server documentation for details... -- Jakub Narebski Poland --
Try to access the repository from a web browser first. If you don't have directory listing enabled, opening a file like HEAD should work. -- Matthieu --
No, it's not. You pushed via ssh, but you clone via http. When you point your web browser to http://kites/pub/git/erez.zilber/my_test.git what do you see? Error 404 or a directory listing? -- Hannes --
So your clone address for git:// is wrong, you don't need the /pub/git: git clone git://erez.zilber@kites/erez.zilber/my_test.git As you've moved the root of the filesystem as far as git-daemon is concerned to /pub/git with the --base-path option. I suspect a similar problem for http[s] depending on how you've mapped /pub/git into your webserver. rather than: git clone ssh://erez.zilber@kites/pub/git/erez.zilber/my_test.git for ssh which does start at the root of the filesystem. Cheers, Rob --
I understand. However, when I try to run it according to your suggestion: [root@kd001 t]# git clone git://erez.zilber@kites/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ fatal: Unable to look up erez.zilber@kites (port 9418) (Name or service not known) fetch-pack from 'git://erez.zilber@kites/erez.zilber/my_test.git' failed. I also tried to run it without "erez.zilber@": [root@kd001 t]# git clone git://kites/erez.zilber/my_test.git Initialized empty Git repository in /home/erez.zilber/work/tmp/t/my_test/.git/ kites[0: 172.16.1.11]: errno=Connection refused fatal: unable to connect a socket (Connection refused) fetch-pack from 'git://kites/erez.zilber/my_test.git' failed. Is there any log file on the server that can help me trace this problem (something like /var/log/httpd/error_log but for the git protocol)? Thanks, Erez --
That error is saying that the name of the service is wrong, so you're This looks like that either there is nothing listening (if you're running though xinetd have you restarted it? And have you added the right bits to /etc/services?) or there's a firewall in the way... git on my machine (running via xinetd) it goes straight into /var/log/ messages. A grep -i git on that file should produce something. Cheers, Rob --
The problem was that it listened to requests coming from the local machine. Now (after fixing that), everything seems to work. Thanks for the help. BTW - I'm currently running git-daemon in the following way: sudo git-daemon --base-path=/pub/git/ --export-all Is there any advantage to run it through xinetd? How do you run it? Thanks, Erez --
You probably want to run it from something that init runs, or you'll have to figure it out again when you reboot the server in a while. So you either want a suitable init script (Gentoo, for example, has one in their git package), or to run it through xinetd (which you almost certainly have an init script for). -Daniel *This .sig left intentionally blank* --
Thanks. I was able to config xinetd, and everything seems to work now. I would like to thank everyone here for the quick and very useful help. Erez --
