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.
- Runs on your computerYou clone it and start it yourself. No account, no server in between.
- Your keys stay thereThe GitHub token and bucket keys are read on your machine. This website never sees them.
- You can get it backOne command restores every repository as a git directory you can clone.
How it works
Once it runs on your computer, the app walks you through four screens.
What gets saved
A finished run writes the repositories you selected, plus a short record of your account.
Your repositories
The git history of each repository you select, with branches, tags, and notes. Repositories you created that are not forks start selected.
Your commits
Commits you authored in those repositories.
Open-source pull requests
Pull requests you opened on public repositories you do not own. The code of those repositories stays where it is.
Merged pull requests
How many of those pull requests merged, and which repositories they were on.
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
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
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
Start the app
Leave this terminal open. Scheduled backups run while it is open.
npm install npm run dev
- 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.