index : gitrs
A lightweight web interface for browsing Git repositories, implemented in Rust
about summary refs log tree commit diff
author Yousef Al-Harbi <yo2w86@gmail.com> 2026-11-17 22:23:40 +0300
committer Yousef Al-Harbi <yo2w86@gmail.com> 2026-11-17 22:23:40 +0300
commit a94fc7465952fc1cfcdbbb18943d23cb8559a77d [patch]
tree 1f15c8c47430cfc4f8e8a8901b46cf6c502e0f2b
parent d8f904a13185e5a651dfd127163c59ef7bda849e
download a94fc7465952fc1cfcdbbb18943d23cb8559a77d.tar.gz

Update README.md

Diffstat

-rw-r--r-- README.md 74
 1 file changed, 62 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md
index 78ae35f..6d6c7f2 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,63 @@
<div align="center">
  <h1> git-rs 🦀 </h1>
  <strong>A web interface fot git built in Rust.</strong>

  <br>
  <br>
  <img src="https://img.shields.io/badge/license-GPL--3-blue?style=for-the-badge" alt="License">
  <img src="https://img.shields.io/badge/built%20with-Actix-red?style=for-the-badge" alt="Actix">
</div>
A cgit-like interface built in Rust using Actix, gitoxide and Askama.

[✨Screenshots](docs/screenshots/)
# git-rs

A fast, minimal web interface for self-hosted Git repositories, inspired by `cgit` and written in Rust using Actix Web, `gix` (gitoxide), and Askama templates.

![Repositories index](docs/screenshots/repos_page.png)
[*Demo*](https://git.y2w8.online)

## Features

- Browse repositories, branches, tags, commit logs, and file trees
- Unified diffs with diffstat bars and raw `.patch` export (`git am` compatible)
- Download `.tar.gz` snapshots of any branch, tag, or commit
- Read-only HTTP smart protocol support (`git clone` / `git pull`)
- Automatic filesystem watcher (`notify`) that picks up new or removed repositories in `/srv/git` without restarting the server
- Markdown rendering for repository `README` files
- Static assets and templates compiled directly into a single binary

More screenshots are available in [`docs/screenshots/`](docs/screenshots/).

## Usage

By default, `git-rs` reads bare repositories from `/srv/git` and listens on `127.0.0.1:80`:

```sh
git-rs --url 0.0.0.0 --port 80 --repos-dir /srv/git
```

### Options

| Flag | Default | Description |
| :--- | :--- | :--- |
| `-u, --url <URL>` | `127.0.0.1` | Bind address |
| `-p, --port <PORT>` | `80` | Port to listen on |
| `-r, --repos-dir <DIR>` | `/srv/git` | Directory containing bare Git repositories |

## Repository Metadata

For each bare repository in `/srv/git/<repo>`:

- **Description:** Write a plain-text description to `/srv/git/<repo>/description`
- **Owner:** Set `gitweb.owner` in the repository config:
  ```sh
  git -C /srv/git/<repo> config gitweb.owner "your-name"
  ```

## Building

```sh
cargo build --release
```

To run as a `systemd` service, copy [`git-rs.service`](git-rs.service) to `/etc/systemd/system/` and enable it:

```sh
sudo cp target/release/git-rs /usr/bin/git-rs
sudo cp git-rs.service /etc/systemd/system/git-rs.service
sudo systemctl daemon-reload
sudo systemctl enable --now git-rs
```

## License

Licensed under the [GPL-3.0](LICENSE) license.