Migrating from cgit to stagit

Published: Jul 14, 2025
Reading time: 2 min
Tags: Docker, Infrastructure, Linux, Software

I’ve used cgit for quite some time now and while it works for the most part it doesn’t seem to work …all that well. Every now and again I’ll get errors like “An error occurred while reading CGI reply (no response received)” when opening repositories where the contents haven’t changed for months or the container I use won’t be able to be restarted without being recreated first.

This is probably not helped by me syncing all of these directories via syncthing, running cgit in a docker container or any number of other things but I’d like to try something simpler and a little lighter if possible.

In steps stagit, a static git page generator which seems more up my street.

Initially I had issues running this as it isn’t availabke in the ArchLinux ARM package repositor, and the AUR pkgbuild doesn’t compile on aarch64 or even manually so that again is probably an issue with my setup. In a very prophetical way, I ended up using Nix to run the software which just plowed on without any issues after being installed via:

nix-env -f '<nixpkgs>' -iA stagit

Then I built a quick script to loop through my source_directory, running the program on any git repositories it finds before generating an index for easier browsing.

After this, all that’s needed is to serve the directory via a simple nginx container and you’re pretty much done.