sudo mkdir -p /var/www/git/rep1 sudo git --bare init sudo chown -r www-data.www-data /var/www/git
SetEnv GIT_PROJECT_ROOT /var/www/git/ SetEnv GIT_HTTP_EXPORT_ALL AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /var/www/git/$1 AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/www/git/$1 ScriptAlias /git/ /usr/lib/git-core/git-http-backend/ <location /git> AuthType Basic AuthName "Git Repository" AuthUserFile /etc/apache2/passwd.git Require valid-user </location>
sudo htpasswd -c /etc/apache2/passwd.git user1
sudo /etc/init.d/apache2 restart