Note: This post is of technical nature, readers who are not interested in programming and computer hacking are invited not to read it.
GIT is a state of the art Source Code Management, this is not just a source code management it is distributed source code management designed for collaboration between many contributors. This is the system used by the Linux kernel.
I have set up local repositories for several of my projects, since I work on different computers and to some of the projects I have some contributors, I needed also a remote repositories.
For all of you who want to learn more about git, I would recommend the following book: http://progit.org/book/
I also wanted a way to view the repositories from the web so I have set up gitweb.
I found many articles on setting gitweb, each one is different from the other and most of them does not work so I decided to add my own post at this subject.
The first stage is install gitweb using the command:
sudo apt-get install gitweb
The second stage was copying the repositories to /var/git
Next I have set up a subdomain for the gitweb website. The DocumentRoot of this domain was set to /var/git where all the repositories will reside. The repositories will be copied there using scp.
The directives for this sub-domain are:
<VirtualHost *:80>
DocumentRoot “/var/git”
ServerName git.helicontech.co.il
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Alias /gitweb/gitweb.css /usr/share/gitweb/gitweb.css
Alias /gitweb/git-logo.png /usr/share/gitweb/git-logo.png
Alias /gitweb/git-favicon.png /usr/share/gitweb/git-favicon.png
<Directory “/var/git”>
Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch
AllowOverride All
Order allow,deny
allow from all
AddHandler cgi-script cgi
DirectoryIndex /cgi-bin/gitweb.cgi
</Directory>
</VirtualHost>
This file resides under: /etc/apache2/sites-available
Then restart apache and that’s it, much easier then all other explanations I have found on the web.

