enricorossi.org

Enrico Rossi


Gitweb installed

I have managed to install gitweb to give the opportunity to other to watch the development of some of my projects.

I hope in the near future to have the time to put other sources in it and eventually do some work on header and footer.

The important thing is that it is there and it can be used.

Inside any project page there is the URL to which you can eventually clone the software if you like or want to test it.

Right now the only way to commit things on these git repositories is via ssh on my server, which require an account.

To install and configure gitweb on a Debian lenny server I have created a folder for the git project like “/home/git/”, then installed gitweb from the Debian with:

apt-get install gitweb

I have modified the /etc/gitweb.conf like

# path to git projects (<project>.git)
$projectroot = "/home/git";

# directory to use for temp files
$git_temp = "/tmp";

# target of the home link on top of all pages
$home_link = $my_uri || "/gitweb/";

# html text to include at home page
$home_text = "indextext.html";

# file with project list; by default, simply scan the projectroot dir.
$projects_list = $projectroot;

# stylesheet to use
$stylesheet = "/gitweb/gitweb.css";

# logo to use
$logo = "/gitweb/git-logo.png";

# the 'favicon'
$favicon = "/gitweb/git-favicon.png";

I’ve also added to the apache configuration these lines:

  SetEnv GITWEB_CONFIG /etc/gitweb.conf
  RewriteEngine on

  # make the front page an internal rewrite to the gitweb script
  RewriteRule ^/gitweb/$  /cgi-bin/gitweb.cgi [L,PT]

  # make access for "dumb clients" work
  RewriteRule ^/gitweb/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]

  Alias /gitweb/ /usr/share/gitweb/
  <Directory "/usr/share/gitweb">
          AllowOverride None
          Order allow,deny
          Allow from all
  </Directory>

To find more information and how to install and configure gitweb see gitweb website.

To browse the source of a project see “http://enricorossi.org/gitweb/example.git" and clone it with:

git clone http://enricorossi.org/git/example.git

See the difference between the two, for browsing the URL is “…/gitweb/…” while for cloning is “…/git/…”.

In the future, with more project hopefully shared among others I will eventually switch to a place like github.