1. サーバ側
cd /var/www
mkdir git
cd git
mkdir TmpRepos
cd TmpRepos
git init --bare --shared
git update-server-info
cd ..
htpasswd -c /var/www/git/passwd_git git
SetEnv GIT_PROJECT_ROOT /var/www/git
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
<LocationMatch "/git">
Order allow,deny
Allow from All
AuthName "Git"
AuthType Basic
AuthUserFile /var/www/git/passwd_git
Require valid-user
</LocationMatch>
ウェブサービスの再起動:
/etc/rc.d/init.d/httpd restart
2. クライアント側
GIT_CURL_VERBOSE=1 git clone http://servername.jp/git/TmpRepos
最後にスラッシュ(/)を付けたら、エラーになったので、注意。