Back up GitHub, GitLab and Bitbucket repositories to your own storage
A code host is one account away from losing everything: a suspended organisation, a deleted repository, a lapsed plan. Keep a copy you control, with its whole history.
What it copies
- Each repository as a git bundle: every branch and tag with its full history, in one file.
git clone name.bundlegives the repository back, anywhere. - The wiki, where the repository has one, as a bundle of its own.
- Issues and pull requests (merge requests on GitLab) as Markdown, with their comments, labels and state.
- Releases with their notes, and the files attached to them on GitHub; Bitbucket's Downloads.
- GitLab.com or your company's own GitLab server, as long as it is reachable over https.
Steps
- Make a token with read access: a fine-grained personal access token on GitHub, a personal access token with
read_apiandread_repositoryon GitLab, an API token on Bitbucket. - On the Clouds screen, add GitHub, GitLab or Bitbucket and paste it. Every repository the token can read is included, so a token limited to some repositories copies only those.
- Press Copy into a cloud on its row, choose where, and keep every night ticked.
What it does not do
- Comments on individual lines of a pull request's code, CI pipelines and their logs, projects and discussions are not copied.
- A repository is copied again only after a push, and an issue only when it changes, so nightly runs are quick.
Questions
Why a bundle rather than a zip of the code?
A zip has one branch at one moment. A bundle is the repository itself, history and all, which is what a backup has to be to be worth restoring.
Can it write back to GitHub?
No. It reads only; nothing is pushed or changed on the code host.
Try it
Prepaid: 30 GB free, then 500 GB for ₹100 or 2,500 GB for ₹500, each valid a year. No card is asked for to start.