Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 example.com/git

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
add comment

1 Answer

up vote 4 down vote accepted

Ok the gitweb part:

you have to install the package gitweb 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";

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

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

The GIT part itself:

I STRONGLY recommend the use of gitosis (http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way)

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 http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way

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

If you need more help on gitosis drop me a comment

EDIT: it might be neccessary to issue usermod -a -G git www-data and a cd /home/git/repositories ; chgrp -R git * to fix apache permission problems.

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
    
scie.nti.st/2007/11/14/… 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
add comment

Your Answer

 
discard

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.