Monitoring config files with git/cogito and displaying them nicely with gitweb

01.11.2005 at 11:31

I recently took a look at the git-webinterface on kernel.org and it really attracted me. I thought it would be nice to manage the config files in my home directory with git and make them available on the net via gitweb.

If you are new to git/cogito i would strongly recommend to investigate a few minutes and work through the README.

In debian you can install git and cogito with apt-get install cogito. And then proceed as explained in the README.

Per default cg-init adds all files in the current directory to the repository which is actually not that useful for monitoring config files in a home directory where only dotfiles are of interest. However newer version of cogito provide a few command line options for us -I is especially handy because it doesn't perform an initial commit at all.

So we are able to set up a git repository without any files by running

cg-init -I

Afterwards you can continue by adding further files as you like, if an error occurs at the initional commit you should add the -C option.

cg-add .bash_profile

Now that the files are added we can do an initial commit.

cg-commit -m"Initial commit"

For further help with cogito or git read the corresponding manual pages.

So now lets install gitweb.

apt-get install gitweb

Gitweb expects the git-repostries in /var/cache/git but this can easily be changed by editing /etc/gitweb.conf. However i prefer to symlink the content from my home directory to the default gitweb project directory as shown below.

ln -s /home/marc/.git /var/cache/git/config-files.git

That's it you can know view your repository on http://localhost/cgi-bin/gitweb.cgi (assuming that apache is configured properly of course).

Here is my final git repository to handle my configfiles.

Marc

Comments (0)

There are currently no comments available