Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have recently began storing code, that I write on a local server I have at home.

I was hoping to start a gitweb instance at home so I can see commits and track progress with my other team mates.

I have tried server tutorials online with no luck. I would like gitweb to be accessed by

I would like my code to be place in /code/git

I would appreciate any help! Please try to be explicit as possible, because I clearly dont know what i am doing. I have read tons of articles.

Please and thank you.

share|improve this question
up vote 5 down vote accepted

The gitweb part:

You have to install the package gitweb with sudo apt-get install gitweb

Then you have to edit the apache gitweb config file

$EDITOR /etc/apache2/conf.d/gitweb

change the line Alias /gitweb /usr/share/gitweb to

Alias /git /usr/share/gitweb

open the /etc/gitweb.conf file:

you have to change the line $projectroot ".." to $projectroot "/code/git"

and change any other line containing /gitweb to /git for example

$stylesheet = "/gitweb/gitweb.css";


$stylesheet = "/git/gitweb.css";

then reload you apache webserver with sudo /etc/init.d/apache2 horse-reload

The GIT part itself:

I STRONGLY recommend the use of gitosis (

REMEMBER if you use gitosis the line $projectroot in /etc/gitweb.conf has to be

$projectroot = "/home/git/repositories/";

You can find detailed information on howto setup gitosis at

describing the full gitosis setup is too long for this answer.

If you need more help on gitosis drop me a comment

To fix apache permission problems, it might be necessary to do:

adduser www-data git
chgrp -R git /home/git/repositories
share|improve this answer
whats the difference between git and gitosis. – myusuf3 Nov 1 '10 at 13:43
gitosis is a script to setup secure git hosting. (authenticate users with ssh and stuff.) its pretty straigt forward with a special git repository which contains a config. In this config you can configure the other git repositories – aatdark Nov 1 '10 at 20:40
that is interesting to me. could you modify your answer to include gitosis setup? – myusuf3 Nov 3 '10 at 13:17… is very detailed ( i used it for myself). If you experience a problem at one step, write me a comment – aatdark Nov 6 '10 at 17:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.