GitGen is a lightweight static website generator for local Git repositories written in Python. It scans a directory of Git repositories and produces a navigable, self-contained HTML website similar in spirit to cgit or GitWeb, but without any server-side dependencies.
The generated site includes a repository index, per-repository README rendering, file listings, commit history, and detailed commit views with diffs.
GitGen generates a static HTML site with the following capabilities:
HEADAll output is static HTML and CSS, suitable for hosting on any static web server.
$PATHPython dependencies:
Requires markdown.
Install with:
pip install markdown
GitRepoScanner:
def __init__(self, base_path: str = "/path/to/Git/repositories")
python3 gitgen.py
git-website/ directory by default.Open git-website/index.html in a browser or deploy the directory contents to a static web host.
The generated output has the following structure:
git-website/
├── index.html
├── main.css # main.css is not generated*
├── repo-name/
│ ├── index.html # README / overview
│ ├── files.html # File listing
│ ├── commits.html # Commit list
│ └── commits/
│ └── abc1234.html # Individual commit pages
Each repository gets its own directory containing all related pages.
* main.css is not generated but included in this repo. Add it manually to the git-website directory.
GitGen looks for README files in the following order:
Markdown READMEs are rendered using Python-Markdown with these extensions enabled:
Non-Markdown READMEs are rendered as escaped pre-formatted text.
This project is made available under a GPL3 licence -- see COPYING for the full text.