You are right, somehow the hook didn't run I think, don't know why. After I run it manually, the http clone got the right version.
[root@cmtoldshrdjk01 hooks]# exec git update-server-info Let me setup the smart http. Thanks Jirong On Tue, Feb 25, 2014 at 8:16 AM, Konstantin Khomoutov < flatw...@users.sourceforge.net> wrote: > On Mon, 24 Feb 2014 12:52:05 -0800 (PST) > Jirong Hu <jirong...@gmail.com> wrote: > > > http://git-scm.com/book/en/Git-on-the-Server-Public-Access > > > > I was following the above link to setup http access for GIT. But > > after this > > issue:https://groups.google.com/forum/#!topic/git-users/nL0qZXiBHqw, > > I think my http settings are not right. This is what I do: > > 1. Change the DocumentRoot= /opt/git, since /opt/git/simple.git is > > the repository I want to access. > > 2. Created a git.conf in /etc/httpd/conf.d, has the LDAP access > > information. It works fine. > > 3. chmod a+x simple.git/hooks/post-update > ^^^^ > 1. 'x' alone is not enough to execute a program--'r' is needed as well. > 2. Granting execute permission to "all" ('a') is not needed if the > user or a group of users which are about to execute that hook > are already granted these permissions explicitly. > > > There is one more thing I am not sure: the permission of > > /opt/git/simple.git. Who shall own this directory? The URL above says > > "www-data", but I cant' find this group name in my server. My Apache > > is running under apache:apache. > > "www-data" is a Debianism, found on Debian and its derivatives (Ubuntu > included); since Ubuntu is the winning distro even on servers these > days, many guides found in the internets just assume this "common > ground". So substitute "system user for the Apache web server" instead > of "www-data" and proceed. > > [...] > > drwxrwsr-x 7 root ccusers 4096 Feb 21 14:22 simple.git > [...] > > Well, the guide from The Book you followed is unfortunately outdated: > it deals with the so-called "dumb" HTTP transport which still works in > newer versions of Git but is not recommended for using as it's *slow:* > it basically crawls over the objects and packfiles it literally fetches > one by one using HTTP calls. For this setup, your settings look mostly > okay. One caveat though: the purpose of the post-update hook is to > call a special Git command which prepares the repo *updated with the > last commit* to be fetched from using that dumb HTTP transport. So if > you didn't run that hook (either by hand (note that you should `su` to > the Git's user first!) or by pushing to that repo using SSH) your > client Git won't fetch anything useful. > > Hence I'd say the real way to fix this is to set your web server up to > serve the newer "smart" HTTP transport which basically uses the web > server to host a CGI Git process which, when started, communicates > directly with the Git client process making the whole thing work as fast > as fetching via native Git protocol ("git://", served by `git-daemon`). > This guide  explains how to set things up. > > 1. https://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.