DeSynkro/RepoHerder
About
A tiny self-hosted web app that keeps local copies of your favorite GitHub repositories up to date. Paste a repository URL, choose where it should live, and RepoHerder clones it with full history.
Web & App DevelopmentMeasured star growth
- in 24h
- Collecting history
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original
Your repos, kept fresh.
Paste a repository link, choose a folder, and RepoHerder keeps the checkout current.
Built by DeSynkro with assistance from OpenCode.
RepoHerder is a small self-hosted web app for keeping local copies of GitHub, GitLab and Codeberg repositories up to date. It clones each repository with its full history, checks for new commits on an interval, and fast-forwards the checkout when the remote moves. It never overwrites local changes.
Quick start
You need Git and Docker with Compose.
git clone https://github.com/DeSynkro/RepoHerder.git
cd RepoHerder
docker compose up --build
Open http://localhost:8080 and create the admin password on the first-run screen. No configuration is required for public repositories.
Everything stays inside the project directory:
data/— state, logs and temporary filesrepos/— default checkout root
RepoHerder does not write loose files outside those folders.
To stop it:
docker compose down
For a private repository token, a different port or a custom clone root, copy
.env.example to .env and edit it first. See Configuration
and Changing the port.
Changing the port
The container always listens on 8080 internally; Compose maps that to the host
port. To use a different host port:
- Copy
.env.exampleto.envif you do not already have one. - Set
REPOHERDER_PORT=9000(or any free port). - Run
docker compose up -d. - Open http://localhost:9000.
No rebuild is needed for a port change. If you run the binary directly instead
of Compose, set REPOHERDER_ADDR=:9000.
Adding a repository
- Open the Add a repository form.
- Paste a GitHub, GitLab or Codeberg URL, for example
https://github.com/owner/repoorhttps://gitlab.com/group/subgroup/repo. - Optionally type a category, or pick one from the suggestions.
- Click Add repository. The branch picker opens with the default branch already ticked. Tick any other branches you want, then click Add selected branches.
- Leave the default storage location, or tick Use a custom directory to choose a mounted folder and optional subfolder.
- Submit the form.
To track another branch of the same repository, click Add repository and
tick the extra branches in the picker. RepoHerder stores each extra checkout as
<name>-<branch>, for example site-dev or site-feature-foo. Adding the same
branch twice is refused.
If a selected branch already has a folder, the picker lists it and asks before replacing. The old folder is kept as a timestamped backup by default. Select all ticks every branch that is not already tracked.
If a folder already exists at the destination, RepoHerder shows a confirmation
over the dashboard instead of overwriting it. The backup box is ticked by
default and keeps the old folder as <name>.bak.<timestamp>; untick it to delete the old
copy after a successful clone. If the clone fails, the old folder is moved back
either way. The timestamp uses your browser's timezone.
If the link points at another host, open Hosts in the sidebar and add it first. The dashboard error links back to that page.
The clone starts in the background. The dashboard shows the last check, current commit, commit timestamp, last synced time, category, local path and status. Timestamps are displayed in your browser's local timezone. Sync now checks immediately; Pause stops the scheduled checks; Sync all checks every active repository at once; the Download icon saves the last synced commit as a ZIP; Remove forgets the repository. A Repair icon appears when a checkout has diverged. A Pencil icon edits the category, subfolder, flat layout, host folder and automatic repair. Automatic repair keeps a timestamped backup and clones the branch fresh. A shield icon in the row shows when it is on. The delete confirmation overlay has an optional checkbox to delete the local checkout too.
Notifications
Open Notifications in the sidebar to send repository events to Discord, Slack, ntfy or a custom webhook. Choose the webhook URL, the format, the events (Updated, Diverged, Repaired, Error) and the repositories. Send test posts a sample message so you can check the destination immediately.
Discord and Slack messages include the RepoHerder name and logo by default. Untick Include RepoHerder name and logo to use the webhook's own identity instead. Repositories that share the same name show their branch next to the name.
The webhook URL is stored in data/state.json, which is readable only by the
container user. It is never logged. Notifications are currently in beta.
Supported hosts
GitHub, GitLab and Codeberg are supported. GitLab nested groups become
folders, so https://gitlab.com/group/subgroup/repo is cloned to
repos/group/subgroup/repo.
To use a self-hosted server, open Hosts in the sidebar and add its hostname
there. You can also set REPOHERDER_ALLOWED_HOSTS in .env, including a port
when the server is not on 443:
REPOHERDER_ALLOWED_HOSTS=git.example.com:8443
Both the Hosts page and the environment variable only add hosts; they never remove the built-in three.
Custom hosts are a security decision. Only add a server you control or trust: RepoHerder runs git against it and keeps its code. A host on your network can also be used to probe internal services, so do not add link shorteners, paste sites or anything you would not clone from directly.
The add form and the How to use page cover categories, host folders, flat layout, search, sorting and compact view. Private repository tokens are listed in Configuration.
Where files live
By default, state and checkouts are split into two project folders:
| Path | Contents |
|---|---|
repos/ |
Default clone root, grouped as category/owner/repo, host/owner/repo, nested GitLab groups, or flat layouts |
data/state.json |
Repository list, custom hosts, status and admin password hash |
data/logs/ |
Application log |
data/tmp/ |
Temporary files used by git and the app |
Everything is kept inside the project directory. RepoHerder does not write
loose files elsewhere. Back up both data/ and repos/.
Using a folder from your machine
You don’t need to edit docker-compose.yml. Paste full host paths into .env:
REPOHERDER_HOST_PATH_1=/mnt/games
REPOHERDER_HOST_PATH_2=/home/you/projects
Restart:
docker compose up -d
Those folders appear in the Mounted location picker as /external/1 and
/external/2, labelled with the host path. Up to five can be configured.
Leave the others blank.
In the Add form, tick Use a custom directory, choose the mounted location,
and optionally type a subfolder. The picker suggests existing subfolders under
that location; you can also type a relative path. The default remains
./repos.
The subfolder sits inside the category. For example, category Tools with
subfolder MyGame produces repos/Tools/MyGame/owner/repo.
The folder must already exist, and the container user (PUID / PGID) must be
able to write to it. Subfolders inside a configured folder work normally.
Why only five?
Docker Compose cannot loop over an environment list and create one bind mount
per entry. Every volume must be declared in docker-compose.yml, so RepoHerder
pre-declares five convenient host-folder slots. Unused slots are ignored and
never appear in the UI. Five is a convenience limit, not a RepoHerder limit.
Adding a sixth folder
The five REPOHERDER_HOST_PATH_1..5 slots are the only predeclared bind
mounts. A sixth needs one manual volume. Add it under the repoherder
service's volumes: list in docker-compose.yml:
services:
repoherder:
volumes:
- ./data:/data
- ./repos:/repos
- /srv/archive:/external/6
Then append the container path to REPOHERDER_ROOTS in .env:
REPOHERDER_ROOTS=/repos,/external/6
If you already have custom roots there, append /external/6 to the existing
comma-separated list. Restart:
docker compose up -d
/external/6 then appears in the Mounted location picker. There is no
REPOHERDER_HOST_PATH_6; this manual volume is the sixth slot. The host folder
must exist and be writable by PUID/PGID.
For many folders, mount one common parent once and use subfolders under it, or generate a Compose override file from a list.
Configuration
| Variable | Default | Purpose |
|---|---|---|
PUID / PGID |
1000 / 1000 |
Owner of ./data and ./repos; set these if your host user is not UID/GID 1000 |
REPOHERDER_PORT |
8080 |
Host port for the web UI |
REPOHERDER_GITHUB_TOKEN |
empty | Optional token for GitHub repositories |
REPOHERDER_GITLAB_TOKEN |
empty | Optional token for GitLab repositories |
REPOHERDER_CODEBERG_TOKEN |
empty | Optional token for Codeberg repositories |
REPOHERDER_HOST_TOKENS |
empty | Self-hosted tokens as host=username:token,host2=token |
REPOHERDER_CHECK_INTERVAL |
15m |
How often repositories are checked |
REPOHERDER_ROOTS |
/repos |
Comma-separated clone roots |
REPOHERDER_HOST_PATH_1..5 |
empty | Optional host folders shown as /external/1..5 |
REPOHERDER_ALLOWED_HOSTS |
empty | Extra repository hosts beyond the built-in GitHub, GitLab and Codeberg |
REPOHERDER_ALLOW_PRIVATE_HOSTS |
false |
Allow self-hosted hosts on private or loopback addresses |
REPOHERDER_PUBLIC_URL |
empty | Browser-facing URL when a proxy or tunnel changes Host |
REPOHERDER_SECURE_COOKIES |
false |
Set true when serving over HTTPS |
REPOHERDER_GIT_TIMEOUT, REPOHERDER_MAX_CONCURRENT and TZ are also
available. Backup folder timestamps follow the browser; TZ covers logs and
the fallback when JavaScript is disabled. See .env.example.
How updates work
By default, each repository is checked every 15 minutes. Change
REPOHERDER_CHECK_INTERVAL in .env to adjust it, then restart the container.
RepoHerder runs git ls-remote first. If the remote commit has not changed, it
does nothing else. If it has changed, it fetches and runs a fast-forward-only
merge.
- Local changes: fetch only, mark
Local changes, leave the checkout alone. - Diverged or force-pushed: stop, mark
Diverged, and leave the checkout alone until you use the repair action. Repair keeps a timestamped backup and clones the branch fresh. If Automatically repair divergences is enabled, RepoHerder does this on the next check and keeps the backup. Repeated divergences create more backups, so watch your disk space. - Unreachable or deleted remote: keep the last good copy and retry with backoff.
Up to date means the local commit already matched the remote at the last
check. Updated means the last check found a new remote commit and
fast-forwarded to it; it becomes Up to date on the next check.
Security
- Login is required; the first-run account is stored as an Argon2id hash.
- Repositories are cloned only from HTTPS URLs on an allowed host.
- Hostnames that resolve to private, loopback or link-local addresses are
rejected unless
REPOHERDER_ALLOW_PRIVATE_HOSTS=true. - Each host's token is only offered to that host.
- Clones must stay inside a mounted root; symlinked paths are rejected.
- Git runs without a shell, submodules or LFS smudging.
- The container runs non-root with
cap_drop: ALL,no-new-privilegesand a read-only root filesystem. - No telemetry, analytics or external front-end assets.
Read docs/security.md before exposing the UI beyond your LAN.
Please don't port-forward it
RepoHerder is meant for your LAN or a private VPN. The plain HTTP port should not be forwarded from your router.
Login, Argon2id hashing, CSRF protection and rate limiting are all in place, but this is still a single-admin app with no two-factor authentication and no audit log, and it expects a reverse proxy to terminate TLS. Putting it directly on the internet turns a small home tool into an unnecessary risk.
If you need access from outside your network, a VPN such as Tailscale or
WireGuard is the simplest safe answer. If you really must expose it publicly,
serve it over HTTPS through a reverse proxy, set
REPOHERDER_SECURE_COOKIES=true, use a long unique password, and restrict it to
trusted addresses with a firewall.
Tech stack
| Part | Technology |
|---|---|
| Language | Go |
| Web UI | net/http and html/template, CSS, one small local refresh script |
| State | One JSON file with atomic writes |
| Git | System git through os/exec |
| Packaging | Docker Compose |
Docs
Support
If RepoHerder is useful to you, you can support me on Ko-fi. More of my work is at desynkro.com.
License
GPL-3.0-only. See LICENSE.
Manrope and OpenMono are used under the SIL Open Font License. Their licenses are included at Manrope-OFL.txt and OpenMono-OFL.txt.
Credits
Explore related projects
Loading…