๐Ÿ“ฆ ctcpip / best-github-backup

the best GitHub backup program (trust me bro)

โ˜… 3 stars โ‘‚ 0 forks ๐Ÿ‘ 3 watching โš–๏ธ GNU General Public License v3.0
๐Ÿ“ฅ Clone https://github.com/ctcpip/best-github-backup.git
HTTPS git clone https://github.com/ctcpip/best-github-backup.git
SSH git clone git@github.com:ctcpip/best-github-backup.git
CLI gh repo clone ctcpip/best-github-backup
ctcpip ctcpip ๐Ÿ”– v2.0.10 144dded 5 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ src
๐Ÿ“ test
๐Ÿ“„ .editorconfig
๐Ÿ“„ .gitignore
๐Ÿ“„ .npmrc
๐Ÿ“„ .nvmrc
๐Ÿ“„ eslint.config.mjs
๐Ÿ“„ LICENSE
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ README.md

Best GitHub Backup

test

this is the best GitHub backup program. it does not suck, and here is why:

  • robust and resilient implementation
  • network failed in the middle of the operation? computer went to sleep? no problem. it will pick up where it left off when you run it again
  • no more worrying about having to start the entire process over again ๐Ÿ™Š
  • flat file database
  • all records are MessagePack files
  • if you're feeling adventurous you can JSON.stringify() the entire database ๐Ÿ™ˆ
  • go on. do it.
  • efficient use of the GitHub API
  • makes as few requests as possible
  • only fetches new data since the last successful run
  • it won't miss anything if there was a failure at any point. checkpoints get updated on a per-repo, per-type basis and only after all records were successfully saved
  • only fetches the important stuff
  • if it's not included, you don't need it. probably. ๐Ÿ™‰

Install

npm i -g best-github-backup

Use

you'll need a GitHub API token with at least repo and read:org scopes ๐Ÿ”ญ

BEST-GITHUB-BACKUP(1)       General Commands Manual       BEST-GITHUB-BACKUP(1)

NAME
     best-github-backup - the best GitHub backup program (trust me bro)

SYNOPSIS
     best-github-backup -t token -o organization [-afgv] [-d daysThreshold]
                        [-e repo1,repo2,...]
     best-github-backup --help
     best-github-backup --version
     (See the OPTIONS section for alternate option syntax with long option
     names.)

DESCRIPTION
     Takes a backup for a given GitHub organization of all repositories that
     the provided token can access.
     It will run in one of two modes:
       1. Backup mode (default), where information is pulled from GitHub, or
       2. Archive mode (option -a), where compressed files are created for
       backups that have been taken already with backup mode.

OPTIONS
     -a, --archive
            Create compressed files for archiving.

     -d daysThreshold, --days daysThreshold
            Skip backup for repos that have been successfully backed up within
            the last daysThreshold days.

     -e repo1,repo2,..., --exclude repo1,repo2,...
            Exclude specified repos from backup.

            Note: this option is ignored in archive mode (option -a).
            Archive mode will process whatever exists from the previously taken
            backup(s). If you want to exclude anything from the archive, it
            must have been excluded from all backups. If you are uncertain, you
            should delete the data folder (data/orgName) and take a new backup
            with the exclude option.

     -f, --force
            Force update GitHub content. (By default, we only query for new
            content since the last successful backup was taken.)

     -g, --git
            Clone (or update existing clone of) git repos.

     -h, --help
            ๐Ÿ†˜ HELP!

     -o org, --org org
            GitHub organization to backup.

     -t token, --token token
            GitHub token to use for authentication.

     -v, --verbose
            Verbose logging.

     --version
            Show version.

EXAMPLES
     best-github-backup -t token -o organization
            Backup an organization.

     best-github-backup -t token -o organization -a
            Create compressed files for archiving.

     best-github-backup -t token -o organization -g
            Backup an organization, including git repositories.

     best-github-backup -t token -o organization -ag
            Create compressed files for archiving, including git repositories.

     best-github-backup -t token -o organization -g -e repo1,repo2,...
            Backup an organization, including git repositories, but excluding
            some repositories.

License

GNU GPLv3 โ˜ญ