{"id":18053368,"url":"https://github.com/luzifer/github2gitea","last_synced_at":"2025-07-10T05:33:55.648Z","repository":{"id":40292699,"uuid":"199191004","full_name":"Luzifer/github2gitea","owner":"Luzifer","description":"Automatically create migrations inside a Gitea instance to mirror Github repositories","archived":false,"fork":false,"pushed_at":"2022-05-16T19:21:06.000Z","size":29,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T20:08:00.359Z","etag":null,"topics":["gitea","github","migration","mirror"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Luzifer.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-27T16:48:24.000Z","updated_at":"2024-09-18T08:24:03.000Z","dependencies_parsed_at":"2022-09-06T21:11:00.916Z","dependency_job_id":null,"html_url":"https://github.com/Luzifer/github2gitea","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Luzifer/github2gitea","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fgithub2gitea","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fgithub2gitea/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fgithub2gitea/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fgithub2gitea/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Luzifer","download_url":"https://codeload.github.com/Luzifer/github2gitea/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fgithub2gitea/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264535998,"owners_count":23624405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitea","github","migration","mirror"],"created_at":"2024-10-30T23:16:57.343Z","updated_at":"2025-07-10T05:33:55.608Z","avatar_url":"https://github.com/Luzifer.png","language":"Go","readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/Luzifer/github2gitea)](https://goreportcard.com/report/github.com/Luzifer/github2gitea)\n![](https://badges.fyi/github/license/Luzifer/github2gitea)\n![](https://badges.fyi/github/downloads/Luzifer/github2gitea)\n![](https://badges.fyi/github/latest-release/Luzifer/github2gitea)\n\n# Luzifer / github2gitea\n\n`github2gitea` is a small tool to automatically create migrations inside a Gitea instance to mirror Github repositories.\n\nFor those wanting to mirror their Github repos to an own Gitea instance in case something happens to their Github user or organization you just need to execute this tool with the required parameters and for every mached repo (see below) a migration will be created to keep your Gitea repo up to date with the Github version.\n\nWhen creating the migration\n\n- the description will be set automatically\n- the repo name will match the name of the repo on Github\n- for private repos a Github token will be added to the sync URL\n- for private repos on Github a private repo will be created in Gitea\n\n## Installation\n\n- Download a pre-built binary from the [releases](https://github.com/Luzifer/github2gitea/releases)\n- `go get -u github.com/Luzifer/github2gitea` the tool\n\n## Usage\n\n```console\n# github2gitea --help\nUsage of github2gitea:\n  -n, --dry-run                    Only report actions to be done, don't execute them\n      --gitea-token string         Token to interact with Gitea instance\n      --gitea-url string           URL of the Gitea instance\n      --github-token string        Github access token\n      --log-level string           Log level (debug, info, warn, error, fatal) (default \"info\")\n      --mapping-file string        File containing several mappings to execute in one run\n      --migrate-archived           Create migrations for archived repos\n      --migrate-forks              Create migrations for forked repos\n      --migrate-private            Migrate private repos (the given Github Token will be entered as sync credential!) (default true)\n      --no-mirror                  Do not enable mirroring but instad do a one-time clone\n      --source-expression string   Regular expression to match the full name of the source repo (i.e. '^Luzifer/.*$')\n      --target-user int            ID of the User / Organization in Gitea to assign the repo to\n      --target-user-name string    Username of the given ID (to check whether repo already exists)\n      --version                    Prints current version and exits\n```\n\nYou can see there is a lot of options you need to set so here is a little walk-through:\n\n| Option | Required | Description |\n| ---- | :---: | ---- |\n| `dry-run` | | You should enable it at first to have a look what github2gitea will do |\n| `gitea-token` | X | Go to \"Settings\" in your profile menu, create a new access token |\n| `gitea-url` | X | The URL your Gitea is available at. For example: `https://try.gitea.io/` |\n| `github-token` | X | Fetch it in your user-settings under \"Developer Settings\" and assign `repo` permissions |\n| `log-level` | | The levels used are `debug`, `info`, `warn`, `error` - Most users should use `info` |\n| `mapping-file` | (X) | Executes more than one mapping in one execution to save Github requests |\n| `migrate-archived` | | Set to `true` to also create migrations for archived repos |\n| `migrate-forks` | | Set to `true` to also create migrations for forked repos |\n| `migrate-private` | | Set to `false` not to create migrations for private repos |\n| `no-mirror` | | Set to `true` not to set up mirroring but only clone the repo |\n| `source-expression` | (X) | Regular expression to match the *full name* of the repo: `^Luzifer/` will for example match `Luzifer/github2gitea` |\n| `target-user` | (X) | ID of your Gitea user or organization (ask your instance admin to look it up in the site admin) |\n| `target-user-name` | (X) | Name of the user the ID belongs to |\n\nDuring the `dry-run` github2gitea will print warnings for any action not executed due to the dry run. Keep an eye on the logs.\n\nYou need to specify either a `mapping-file` or `source-expression`, `target-user` and `target-user-name`. If both are specified the `mapping-file` wins and the CLI parameters are not used.\n\n### Mapping-File\n\nThe format of the file is quite simple and in the end reflects the options you can use on the CLI:\n\n```yaml\n---\n\nmappings:\n  - source_expression: '^Luzifer/'\n    target_user: 1\n    target_user_name: luzifer\n\n  - source_expression: '^luzifer-ansible/'\n    target_user: 3\n    target_user_name: luzifer-ansible\n\n  - source_expression: '^luzifer-docker/'\n    target_user: 2\n    target_user_name: luzifer-docker\n\n...\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluzifer%2Fgithub2gitea","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluzifer%2Fgithub2gitea","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluzifer%2Fgithub2gitea/lists"}