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

https://github.com/jhnc-oss/github-mirror

Repository mirror automation.
https://github.com/jhnc-oss/github-mirror

git git-mirror github github-mirror github-mirrors

Last synced: about 1 year ago
JSON representation

Repository mirror automation.

Awesome Lists containing this project

README

          

# GitHub Mirror

[![mirror](https://github.com/jhnc-oss/github-mirror/actions/workflows/mirror.yml/badge.svg)](https://github.com/jhnc-oss/github-mirror/actions/workflows/mirror.yml)
[![License](https://img.shields.io/badge/license-MIT-yellow.svg)](LICENSE)

Mirrors repositories to GitHub.

**Note:** Action runs on branches other than `main` execute a dry run and wont update the remote repository.

## Add Mirror

:warning: *All branches which aren't in the upstream repository are lost*.

1. Create a **fork** (if on GitHub) or an **empty destination repository**, same name as upstream is recommended
2. **Generate SSH keys**: `ssh-keygen -t ed25519 -C github-mirror`
- Add the *private* key as a new secret to this project (`SSH_PRIVATE_KEY_`, all uppercase)
- Add the *public* key as *writeable* deployment key `github-mirror` to the destination repository
3. **Add configuration** to [`mirror.yml`](./.github/workflows/mirror.yml)
4. *(Optional)* **Set default branch** of the destination repository according to upstream

### Example

```yml
mirror_config:
- {
src_repo: "",
dest_repo: "",
key_id: "",
}
- ...
```