* Front Page * Table of Contents * Return to Town

Cgit

How to host your own Git repo online, with a web interface.

the basics

Point cgit at the ~/public_repos directory on the server.

Have an entry in your ssh config to your server. Let's say it's called my_server (Host my_server would be the first line of such an entry).

ssh my_server; cd ~/public_repos; git init --bare foo.git; exit; git remote add origin my_server:public_repos/foo.git; git push -u origin main

Give collaborators ssh accounts with their shell set to git-shell and put them in a unix group with write access to the repo.

~/public_repos is is a symlink to a directory in /var/www so that cgit can access it inside its chroot.

There is a description file, but in a bare repo the whole thing is in the .git directory. repo/.git <-> repo.git

you can also control some cgit stuff with git config if you have that enabled (with enable-git-config=1 in cgitrc), for example:

Neither git config nor .git/description is tracked.

Credit: ~june


last compiled: 2022-08-07 08:56:07.545629