MCPcopy Index your code
hub / github.com/Tanq16/backhub

github.com/Tanq16/backhub @v0.7.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.7.0 ↗ · + Follow
72 symbols 163 edges 8 files 20 documented · 28%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

BackHub Logo

BackHub

Release GitHub Release

BackHub is a simple GitHub repository backup tool that creates complete local mirrors of your repositories.


Features

  • Full repository mirroring including all branches, tags, and history
  • Concurrent backup processing for multiple repositories defined in a YAML config file
  • GitHub token-based authentication (to be used in an environment variable)
  • Easy restoration capability due to it being local mirror
  • Multi-arch and multi-OS binary for simple one-time usage
  • A unique output provider with a fancy and detailed progress monitoring system

Installation

Binary

The easiest way to use Backhub is to download it from the project releases for your OS and architecture.

Development Build

go install github.com/tanq16/backhub@latest

Build from Source

git clone https://github.com/tanq16/backhub.git && \
cd backhub && \
go build

Usage

Backhub uses an environment variable to authenticate to GitHub. To do this, set your GH_TOKEN variable. This can be done inline with:

GH_TOKEN=pat_jsdhksjdskhjdhkajshkdjh backhub

Alternatively, export it to your shell session with:

export GH_TOKEN=pat_jsdhksjdskhjdhkajshkdjh

With the environment variable exported, backhub can be directly executed multiple times from the command line like so:

# config file
backhub /path/to/config.yaml

# direct repo
backhub github.com/tanq16/backhub

YAML Config File

BackHub uses a simple YAML configuration file:

repos:
  - github.com/username/repo1
  - github.com/username/repo2
  - github.com/org/repo3

For Docker, put the config file in the mounted directory and name it config.yaml.

Using the Local Mirrors

To use a local mirror as a Git repository source (like when you need to restore from the backup), the following can be done:

  1. Directly pull or clone from the mirror treating it as a backup remote in an existing repository: bash git remote add backup /path/to/your/mirror.git git pull backup main # or any other branch git clone /path/to/your/mirror.git new-repo
  2. Serve the mirror via a local git server and use it : bash git daemon --base-path=/path/to/mirror --export-all git clone git://localhost/mirror.git # in a different path
  3. Use the mirror as a git server by refering to it through the file protocol: bash git clone file:///path/to/mirror.git

Being a mirror, it contains all references (branches, tags, etc.), so cloning or pulling from it allows accessing everything as if it's the original. Use git branch -a to see all branches and git tag -l to see all tags in the mirror.

Core symbols most depended-on inside this repo

SetMessage
called by 21
utils/manager.go
AddStreamLine
called by 19
utils/manager.go
UnwindValue
called by 11
utils/json-helper.go
Register
called by 5
utils/manager.go
Complete
called by 5
utils/manager.go
FormatTable
called by 4
utils/manager.go
ReportError
called by 4
utils/manager.go
StopDisplay
called by 4
utils/manager.go

Shape

Method 52
Function 12
Struct 7
TypeAlias 1

Languages

Go100%

Modules by API surface

utils/manager.go37 symbols
utils/json-helper.go13 symbols
functionality/handler.go10 symbols
functionality/git.go5 symbols
tests/progress-manager-test.go3 symbols
cmd/root.go2 symbols
utils/generics.go1 symbols
main.go1 symbols

For agents

$ claude mcp add backhub \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page