thorko . de
Linux / Unix systems administrator
Git over HTTP
Prerequisite
Apache with mod_dav enabled
and git
on debian
a2enmod dav dav_fs
To enable DAV manually create a dav.conf file and include it in your main apache configuration file
LoadModule dav_fs_module /usr/lib/apache2/modules/mod_dav_fs.so
LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so
DAVLockDB /var/lock/apache2/DAVLock
make sure the lock file is writeable by the apache user
create a virtual host in your apache configuration
<VirtualHost *:80>
ServerName git.localhost
DocumentRoot /var/www/git
<Directory /var/www/git>
Dav on
AuthType Basic
AuthName "Git"
AuthUserFile /etc/apache2/passwords/git
<LimitExcept GET HEAD OPTIONS>
Require valid-user
</LimitExcept>
</Directory>
</VirtualHost>
create the password file
htpasswd -c /etc/apache2/passwords/git <username>
create the git repository on the webserver
mkdir /var/www/git
cd /var/www/git
git --bare init
chown -R <apache user>: /var/www/git
move the post-update script and make it executable
mv /var/www/git/hooks/post-update.sample /var/www/git/hooks/post-update
chmod a+x /var/www/git/hooks/post-update
on the client do a clone
git clone http://git.localhost/git
you will get an empty repository. Now add some files to it.
touch README INSTALL; git add README INSTALL; git commit
Once you have done this push it to the server
git push origin master
If you get an error like this "Unable to lock remote branch refs/heads/master" check that you don't have a .htaccess file lying around which overwrites some settings.
![]() | Info |
![]() | Download Zabbix Agent 1.8.10 - amd64 deb file Zabbix Server MySQL 1.8.10 - amd64 deb file Zabbix Frontend 1.8.10 - amd64 deb file Firefox 9.0.1 - x86_64 Thunderbird 9.0 - x86_64 LSI Util - manage LSI raid controller Nictool 2.0.8 Cisco VPN Client 4.9.01 for Mac |
![]() | Goodies Varnishd - Highly scalable web caching server CFengine - Configuration and installation automation of enterprise environments Open Benno - Another open source mail archive system (License: GPL). Lucene search engine, no database needed, mails stored in a directory structure |



