Jeff Mesnil
Weblog · About

(Updated) Gitweb Setup on Mac OS X

November 8, 2010
Git logo + Apple logo

I wrote a post about setting up Gitweb on Mac OS X 2 years ago. Today I was reading it again to setup gitweb on another Mac and the steps have slightly changed.

It assumes that Git is installed in /usr/bin (otherwise, modify the bindir property accordingly).
You just need to modify GITWEB_PROJECTROOT to point to the root of your Git projects.

To install gitweb (from Git 1.7.2.1) on Mac OS X 10.6.4, the steps are now:

# define the projects root
export GITWEB_PROJECTROOT="/Users/jmesnil/Git/"

# retrieve the latest version of git
git clone git://git.kernel.org/pub/scm/git/git.git
cd git/

# install gitweb.cgi
sudo make GITWEB_PROJECTROOT=$GITWEB_PROJECTROOT \
     GITWEB_CSS="/gitweb/gitweb.css" \
     GITWEB_LOGO="/gitweb/git-logo.png"  \
     GITWEB_FAVICON="/gitweb/git-favicon.png"  \
     GITWEB_JS="/gitweb/gitweb.js" \
     bindir=/usr/bin \
     gitwebdir=/Library/WebServer/CGI-Executables/gitweb \
     install-gitweb

# move the static files to the proper folder
mkdir -p /Library/WebServer/Documents/gitweb
cd /Library/WebServer/
mv CGI-Executables/gitweb/static/* Documents/gitweb     

and go to http://localhost/cgi-bin/gitweb/gitweb.cgi