Your repositories, your backup

Keep a copy of your GitHub repositories.

GitHub Backup mirrors repositories from a GitHub user or organization to Gitea or a local directory. Set it up once, run it on demand, or schedule regular backups.

Overview

A straightforward backup workflow

Choose which repositories to include, where they should go, and how often the backup runs.

Two destinations

Send repositories to a Gitea instance or store them as bare Git mirrors in a local directory.

Precise selection

Back up users or organizations. Use allow and deny patterns to choose repositories by owner, name, visibility, fork, and archive status.

Run your way

Run once from the command line or add a cron expression in the configuration for repeated backups.

Quick start

From install to first backup

The configuration editor below generates a JSON file for the command line tool.

1

Install the command line tool

Install with Go, or build from the source repository.

go install github.com/tbxark/github-backup@latest
2

Create a configuration

Use the editor to set a GitHub owner and token, choose a backup provider, then download config.json. You can also import an existing JSON file to edit it.

3

Run a backup

Place the file where the command can read it. Without a cron expression, the tool runs once and exits.

github-backup -config config.json
Configuration

Build your config.json

Configure sources, destinations, and filters. The preview updates as you edit.

Browser editor · No build needed

Run settings

Leave the cron expression empty to run once and exit.

Defaults

Targets inherit fields left blank from these defaults.

default_conf

Default backup provider

Confirmation prompts

Default filters

Match owner/repo/private/fork/archived; booleans are 0 or 1. Deny rules take precedence. Deletion pauses if GitHub returns no repositories or its list shrinks by more than half.

Default repository-specific tokens

Assign clone tokens by repository pattern. A non-empty target mapping replaces the whole default mapping.

Backup targets

Each target is a GitHub user or organization.

Target {{ index + 1 }} {{ target.owner }}
Owner types

Backup provider

Confirmation prompts

Filters

Empty target rules inherit defaults, so an empty list cannot clear default rules.

Repository-specific tokens for this target

Inherits the default mapping when empty.

No targets yet. Select “Add target” to begin.

{{ toast }}