{"id":13587168,"url":"https://github.com/bachp/git-mirror","last_synced_at":"2025-05-16T01:05:46.436Z","repository":{"id":37390783,"uuid":"94142410","full_name":"bachp/git-mirror","owner":"bachp","description":"A small utility that allows to mirror external repositories to GitLab, GitHub and possible more.","archived":false,"fork":false,"pushed_at":"2025-05-12T08:44:48.000Z","size":1212,"stargazers_count":155,"open_issues_count":11,"forks_count":21,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-12T09:59:32.916Z","etag":null,"topics":["git","github","gitlab","mirror","repository-utilities","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bachp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-06-12T21:32:36.000Z","updated_at":"2025-05-12T08:44:45.000Z","dependencies_parsed_at":"2023-09-27T16:52:48.172Z","dependency_job_id":"4db2056d-72ed-4267-9771-de8310035100","html_url":"https://github.com/bachp/git-mirror","commit_stats":{"total_commits":445,"total_committers":10,"mean_commits":44.5,"dds":0.3865168539325843,"last_synced_commit":"132876a915cae47622a28931db715a52a00387dc"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachp%2Fgit-mirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachp%2Fgit-mirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachp%2Fgit-mirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bachp%2Fgit-mirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bachp","download_url":"https://codeload.github.com/bachp/git-mirror/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448579,"owners_count":22072764,"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":["git","github","gitlab","mirror","repository-utilities","rust"],"created_at":"2024-08-01T15:06:03.623Z","updated_at":"2025-05-16T01:05:41.427Z","avatar_url":"https://github.com/bachp.png","language":"Rust","readme":"# Git Mirror\n\nGit Mirror will watch a GitLab or GitHub groups and keep it in sync with external git repositories.\n\n## Usage\n\nInstall git and git-lfs.\n\n1. Create group on your gitlab instance or gitlab.com. e.g. `mirror-test`\n2. Add a repository you like to sync to. e.g `my-project`\n3. Add a description to the project in YAML format containing an `origin` field. e.g. `origin: https://git.example.org/my-project.git`\n4. Execute  set the `PRIVATE_TOKEN` environment variable a personal access token or your private token and execute `git-mirror`\n\n``` sh\nexport PRIVATE_TOKEN=\"\u003cpersonal-access-token\u003e\"\ngit-mirror -g mirror-test\n```\n\nThis will sync the group `mirror-test` on gitlab.com. If you want to sync a group on a different GitLab instance, use the `-u` flag.\n\n``` sh\ngit-mirror -g mirror-test -u http://gitlab.example.org\n```\n\n### Multiple concurrent jobs\n\n`git-mirror` allows to execute multiple mirror jobs in parallel using the `-c \u003cn\u003e` flag.\n\n``` sh\ngit-mirror -g mirror-test -c 8\n```\n\nThis will execute at most 8 sync jobs in parallel\n\n### Description format\n\nFor `git-mirror` to mirror a repository it needs to know where to sync from.\nIn order to achive this `git-mirror` expects the description field of a mirrored project to\nbe valid [YAML](http://yaml.org/) with at least an `origin` field.\n\n``` yaml\norigin: https://git.example.org/my-project.git\n```\n\nA list of currently supported fields\n\n- `origin` Source repository to mirror from\n- `skip`   Temporarily exclude a project from syncing by adding `skip: true`\n- `destination` Reserved for future use\n- `lfs` Disable git lfs mirror for a specific repo with `lfs: false` (default is `true`), only relevant if git-mirror is started with `--lfs`\n- `refspec` Push only refspec.\n  Add the refspec list to use it. Any valid refspec is possible.\n  E.g.\n  ```yaml\n  refspec: [\"master\", \"2.0\", \"+refs/tags/*:refs/tags/*\"]\n  ```\n  See also https://git-scm.com/book/en/v2/Git-Internals-The-Refspec\n\n  Note: If set, this field would override the default (global) refspec from the command line option `--refspec`, if specified. Multiple refs can be set by repeating the option.\n\nAny other fields are ignored\n\n### Mirror to GitHub\n\n`git-mirror` also supports mirroring to GitHub.\n\nThis can be done by specifying GitHub as provider:\n\n``` sh\nexport PRIVATE_TOKEN=\"\u003cpersonal-access-token\u003e\"\ngit-mirror -g mirror-test -p GitHub\n```\n\nThis has been tested against github.com but it might also work with on premise installations of GitHub.\n\n## Container\n\nThere is also a container image available. It can be used with docker or podman as follows:\n\n```\ndocker run -e PRIVATE_TOKEN=\"x\" ghcr.io/bachp/git-mirror git-mirror -g mirror -u http://gitlab.example.com\n```\n\n## Building \u0026 Installing\n\nIn order to build this project you need a least rust v1.18.0. The easiest way to get rust is via: [rustup.rs](http://rustup.rs/)\n\nThe project can be built using cargo\n\n```\ncargo build\n```\n\n## They're using Git Mirror\n\n* [gitlab-mirror-orchestrator](https://gitlab.ow2.org/ow2/gitlab-mirror-orchestrator) tool at OW2 Consortium.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbachp%2Fgit-mirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbachp%2Fgit-mirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbachp%2Fgit-mirror/lists"}