https://github.com/obfusk/ghbak
ghbak - github backup
https://github.com/obfusk/ghbak
backup gist git github
Last synced: 6 months ago
JSON representation
ghbak - github backup
- Host: GitHub
- URL: https://github.com/obfusk/ghbak
- Owner: obfusk
- License: gpl-3.0
- Created: 2020-06-20T22:35:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-24T10:48:45.000Z (over 5 years ago)
- Last Synced: 2025-06-29T20:41:05.368Z (7 months ago)
- Topics: backup, gist, git, github
- Language: Python
- Homepage:
- Size: 64.5 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.GPLv3
Awesome Lists containing this project
README
File : README.md
Maintainer : Felix C. Stegerman
Date : 2020-06-22
Copyright : Copyright (C) 2020 Felix C. Stegerman
Version : v0.1.5
License : GPLv3+
[](https://pypi.python.org/pypi/ghbak)
[](https://github.com/obfusk/ghbak/actions?query=workflow%3ACI)
[](https://www.gnu.org/licenses/gpl-3.0.html)
## Description
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).
## Examples
```bash
$ 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 git@github.com: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 git@gist.github.com:gist-id.git gist-id.git
...
=== summary ===
backed up repos: 42
backed up gists: 37
```
## Help
```bash
$ ghbak --help
```
## Requirements
Python >= 3.5 + click + requests.
## Installing
### Using pip
```bash
$ pip install ghbak
```
### Manually
Install the dependencies (as e.g. debian packages or using `pip`):
```bash
$ apt install python3-click python3-requests # debian/ubuntu
$ pip install click requests # pip
```
Then just put `ghbak` somewhere on your `$PATH` (e.g. `~/bin`).
## License
[](https://www.gnu.org/licenses/gpl-3.0.html)