gitbackup
Open source, MIT licensed

Save the repositories you created.

gitbackup copies your GitHub repositories, with every branch, tag, and note, to Amazon S3, Cloudflare R2, or Google Drive. It runs on your computer, on a schedule if you like.

How it works

Once it runs on your computer, the app walks you through four screens.

gitbackupSetup

What gets saved

A finished run writes the repositories you selected, plus a short record of your account.

Left on GitHub

  • Organization, starred, forked, and collaborator repositories you leave unticked
  • Issues, wikis, releases, and gists
  • The code of a repository where you only opened a pull request

Where it goes

Pick a destination to see what a run stores there. Each run writes to the one place named in .env.

Set GITBACKUP_TO=s3 in .env. A finished run prints your own counts like this. Run it again with no new commits and the last line is unchanged.

personal repos 18
commits 640
open source contributions 11
merged pull requests 7
destination s3
published

Run it on your computer

Four steps in a terminal, about five minutes.

  1. 1

    Clone this repository

    You need git and Node.js 22.18 or newer. Check with git --version and node --version.

    git clone https://github.com/Dhirenderchoudhary/gitbackup.git
    cd gitbackup
  2. 2

    Say where the backup goes

    Copy the example file, open .env, and set GITBACKUP_TO to s3, r2, or drive. Fill in the block for that one destination. The GitHub token can wait for the next step.

    cp .env.example .env
  3. 3

    Start the app

    Leave this terminal open. Scheduled backups run while it is open.

    npm install
    npm run dev
  4. 4

    Open it and follow the four steps

    Paste a GitHub token, tick the repositories, press Start backup, then pick a schedule. The page shows each repository as it is saved.

    Open 127.0.0.1:3000

Get it back

Pick the same destination and an empty folder. Each repository comes back as a bare git directory you can clone.

npx gitbackup restore --to s3 --out ./restored
git clone ./restored/my-repo.git my-repo

Use --to r2 or --to drive for the other destinations.