{"id":20391282,"url":"https://github.com/nicksantamaria/git-mirroring-circleci","last_synced_at":"2026-03-06T16:03:36.040Z","repository":{"id":77314021,"uuid":"65025272","full_name":"nicksantamaria/git-mirroring-circleci","owner":"nicksantamaria","description":"Provides an example on how to use CircleCI for git mirroring.","archived":false,"fork":false,"pushed_at":"2016-08-05T20:14:09.000Z","size":11,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-12T00:47:37.555Z","etag":null,"topics":["circleci","example"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicksantamaria.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2016-08-05T14:32:55.000Z","updated_at":"2024-09-02T10:43:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"b1b92000-11c6-44f6-b407-b76887667fe7","html_url":"https://github.com/nicksantamaria/git-mirroring-circleci","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nicksantamaria/git-mirroring-circleci","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicksantamaria%2Fgit-mirroring-circleci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicksantamaria%2Fgit-mirroring-circleci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicksantamaria%2Fgit-mirroring-circleci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicksantamaria%2Fgit-mirroring-circleci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicksantamaria","download_url":"https://codeload.github.com/nicksantamaria/git-mirroring-circleci/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicksantamaria%2Fgit-mirroring-circleci/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30184885,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T14:42:24.748Z","status":"ssl_error","status_checked_at":"2026-03-06T14:42:14.925Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["circleci","example"],"created_at":"2024-11-15T03:30:27.458Z","updated_at":"2026-03-06T16:03:36.024Z","avatar_url":"https://github.com/nicksantamaria.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Github Mirroring with CircleCI\n\n[![CircleCI](https://circleci.com/gh/nicksantamaria/git-mirroring-circleci.svg?style=svg)](https://circleci.com/gh/nicksantamaria/git-mirroring-circleci)\n\nThis project is an example of how to use CircleCI to automatically mirror a Github repository to another remote. CircleCI offers a [free-tier](https://circleci.com/pricing/) which is sufficient for this use-case.\n\n## Usage\n\n### Repository Setup\n\n1. Copy [circle.yml](circle.yml) from this project into your repository root.\n2. Change the `GIT_MIRROR_URL` variable to the destination git remote URL.\n3. Commit the file to your repo and push to github.\n\n### CircleCI Setup\n\n1. Sign in to CircleCI, authorize it to access Github if asked.\n2. Go to \"Add Projects\" in the sidebar.\n3. Choose your Github user or organsation which owns the repo.\n4. Click the \"Build project\" button for the repo.\n\nThis first build will likely fail as there is no authentication credentials set up yet - see the next section.\n\n### Authentication Setup\n\nThis example will only cover SSH key authentication. \n\n1. Generate a new SSH key, eg `ssh-keygen -t rsa -C \"reponame-mirror\" -f ./reponame-id_rsa`\n2. Go to the CircleCI dashboard, hover over the repository, and click on the cog icon.\n3. Go to the \"SSH Permissions\" tab.\n4. Copy the newly created private key and paste into the \"Private key\" field, eg `pbcopy \u003c ./reponame-id_rsa`\n5. Set the \"Hostname\" field to the hostname of the destination git remote.\n6. Copy the newly created SSH public key, eg `pbcopy \u003c ./reponame-id_rsa.pub`\n7. Add this public key to the destination remote. This process will depend on the system which manages the destination repository. For example:\n   - A deploy key with write access to the destination project (ie, another github repo).\n   - A ssh key for a specific user with write permission to the repo (ie, bitbucket as they dont have write access for deploy keys)\n   - An entry in `~/.ssh/authorized_keys` for custom git setups.\n8. Return to the CircleCI project, find the previously failed build and click \"rebuild\".\n\nAt this point you should have a working system!\n\n## Dogfooding\n\nTo demonstrate this approach, this project uses CircleCI to mirror the [GitHub](https://github.com/nicksantamaria/git-mirroring-circleci) repo to [Bitbucket](https://bitbucket.org/nicksantamaria/git-mirroring-circleci). The CircleCI build history can be viewed here - https://circleci.com/gh/nicksantamaria/git-mirroring-circleci\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicksantamaria%2Fgit-mirroring-circleci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicksantamaria%2Fgit-mirroring-circleci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicksantamaria%2Fgit-mirroring-circleci/lists"}