File : README.md
Maintainer : Felix C. Stegerman <[email protected]>
Date : 2020-06-22
Copyright : Copyright (C) 2020 Felix C. Stegerman
Version : v0.1.5
License : GPLv3+
ghbak - github backup
Mirror (or update) github repos (and issues) and/or gists to:
{basedir}/
{github_username}/
github/
{repo_name}.git
{repo_name}-issues.json
...
gist/
{gist_id}.git
...
The base directory defaults to ./{YYYYMMDD}
(the current date).
$ export GITHUB_TOKEN=your-github-token
$ ghbak --repos --gists --ssh --verbose your-github-username
user: your-github-username
token $GITHUB_TOKEN
GET https://api.github.com/users/your-github-username/repos
...
GET https://api.github.com/users/your-github-username/gists
...
cloning 42 repos...
==> repo your-github-username/your-repo | description
$ cd 20200101/your-github-username/github
$ git clone --mirror -n [email protected]:your-github-username/your-repo.git your-repo.git
...
cloning 37 gists...
==> gist your-github-username | gist-id | description
$ cd 20200101/your-github-username/gist
$ git clone --mirror -n [email protected]:gist-id.git gist-id.git
...
=== summary ===
backed up repos: 42
backed up gists: 37
$ ghbak --help
Python >= 3.5 + click + requests.
$ pip install ghbak
Install the dependencies (as e.g. debian packages or using pip
):
$ apt install python3-click python3-requests # debian/ubuntu
$ pip install click requests # pip
Then just put ghbak
somewhere on your $PATH
(e.g. ~/bin
).