hw-1

build http protal git server for xampp on osx

build http protal git server for xampp on osx

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
1,intsall xampp
2,add 'git.conf' to httpd.conf
//git.conf
<VirtualHost *:80>
SetEnv GIT_PROJECT_ROOT /home/leo/git/ #git目录
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias / /usr/libexec/git-core/git-http-backend/ #将/上的请求转发给git
<Location "/">
DAV on #开启dav扩展
Order allow,deny
Allow from all
AuthType Basic #开启密码验证
AuthName "Git"
AuthUserFile /path/to/apache/conf/vhost/git.passwd
Require valid-user
</Location>
</VirtualHost>
3,create user and password for http access
/path/to/apache/bin/htpasswd -c git.passwd leo
4,create a simple git repo
mkdir -p /home/leo/git/leo_git_test
cd /home/leo/git/leo_git_test
git init --bare
git update-server-info
5,restart apache in xampp
6, test git
git clone http://local/path/leo_git_test