An open API service indexing awesome lists of open source software.

https://github.com/chriscummins/gh-archiver

💾 Clone and update a GitHub user's repos
https://github.com/chriscummins/gh-archiver

backup-script github

Last synced: 2 months ago
JSON representation

💾 Clone and update a GitHub user's repos

Awesome Lists containing this project

README

          


gh-archiver



Mirror a GitHub user's repos locally.

This program fetches a GitHub user's repositories and mirrors them to a local
directory. New repositories are cloned, existing repositories are fetched from
remote.

## Setup

Create a Github [personal access token](https://github.com/settings/tokens/new).
If you intend to mirror your own private repositories, select "repo" from the
list of available scopes. To mirror only your public repositories or those
another user, no scopes are required.

Create a ~/.github/access_tokens/gh_archiver.txt file containing your
the personal access token you just created:

```sh
$ mkdir -p ~/.github/access_tokens
$ cat < ~/.github/access_tokens/gh_archiver.txt
YourAccessToken
EOF
$ chmod 0600 ~/.github/access_tokens/gh_archiver.txt
```

Then build and install the `gh_archiver` program using:

```sh
$ basel run -c opt //datasets/github/gh_archiver:install
```

Requires Python >= 3.6.

## Usage

Mirror a Github user's repositories to a directory using:

```sh
$ gh_archiver --user --outdir
```

## License

Made with ❤️ by [Chris Cummins](http://chriscummins.cc).
Released under [MIT License](https://tldrlegal.com/license/mit-license).