bin+lib ghbu

Backup your GitHub Repositories

8 releases

0.1.7 May 6, 2024
0.1.6 May 5, 2024
0.1.2 Apr 29, 2024
Download history 5/week @ 2024-09-20 8/week @ 2024-09-27 1/week @ 2024-10-04

398 downloads per month

MIT license

14KB
239 lines

ghbu: GitHub Backup

Usage

Backup the repositories owned by user joe:

$ GITHUB_TOKEN=0123abc ghbu --to ~/github-backup --keyfile ~/.ssh/id_ed25519 --user joe

Backup the repositories owned by organization acme:

$ GITHUB_TOKEN=0123abc ghbu --to ~/github-backup --keyfile ~/.ssh/id_ed25519 --org acme

Dependencies

  • git2: clone and fetch Git repositories
  • reqwest: request repositories from GitHub API
  • serde_json: unmarshal GitHub API payloads
  • clap: parse command line arguments

TODO

  • Concurrency
    • interleave API calls with cloning/fetching of repositories
  • Extension
    • implement for GitLab API
    • implement for Gitea API
    • consider supporting HTTPS credentials
    • consider supporting SSH Key from Agent
    • add support for SSH Passphrase (as environment variable)

Dependencies

~13–24MB
~402K SLoC