使用apache 配置http协议的git库
使用apache 配置http协议的git库.
在/home/git/目录下创建gitrepo目录,在gitrepo中创建test.git进入test.git目录执行git init --bare?mv hooks/post-update.sample hooks/post-update./hooks/post-update
apache配置文件部分,git.conf
DavLockDB "/usr/local/apache/var/DavLock"Alias /git "/home/git/gitrepo"<Directory "/home/git/gitrepo/"> Dav On Options +Indexes +FollowSymLinks Deny from all AuthType Basic AuthName "Git" AuthUserFile "/home/git/gitrepo/user.git" AuthGroupFile "/home/git/gitrepo/group.git" Require valid-user</Directory><Directory "/home/git/gitrepo/test.git/"> Allow from all Order Allow,Deny <Limit GET> Require group testproject-read </Limit> <Limit GET PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> Require group testproject-write </Limit></Directory><Location /git> SetHandler None</Location>?user.git 采用htpasswd生成group.git内容如下:
testproject-read: jacktestproject-write: john alex?
machine www.gitserver.comlogin jackpassword 123456