{"id":16467249,"url":"https://github.com/norgul/git-mirror","last_synced_at":"2026-05-05T11:33:22.925Z","repository":{"id":117332813,"uuid":"188272032","full_name":"Norgul/git-mirror","owner":"Norgul","description":"Mirroring/cloning a set of git repositories to a remote location","archived":false,"fork":false,"pushed_at":"2019-07-19T06:57:58.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T02:26:41.221Z","etag":null,"topics":["bitbucket","git","github","mirror","mirrored-repositories"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/Norgul.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":"2019-05-23T16:41:18.000Z","updated_at":"2025-01-21T21:57:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7dfec32-2107-4579-b019-293d461b2b7e","html_url":"https://github.com/Norgul/git-mirror","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Norgul/git-mirror","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Norgul%2Fgit-mirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Norgul%2Fgit-mirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Norgul%2Fgit-mirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Norgul%2Fgit-mirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Norgul","download_url":"https://codeload.github.com/Norgul/git-mirror/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Norgul%2Fgit-mirror/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268297048,"owners_count":24228119,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bitbucket","git","github","mirror","mirrored-repositories"],"created_at":"2024-10-11T11:46:41.701Z","updated_at":"2026-05-05T11:33:15.944Z","avatar_url":"https://github.com/Norgul.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git mirror\nThis is a short script for mirroring a set of repositories\nto a different location together with all branches tags and\ncommit history.\n\nFor example:\n\n```\nhttps://github.com/user/repo1.git ==\u003e https://github.com/new_location/clone1.git\nhttps://github.com/user/repo2.git ==\u003e https://github.com/new_location/clone2.git\nhttps://github.com/user/repo3.git ==\u003e https://github.com/new_location/clone3.git\n```\n\n# Usage\nDownload the repository `git clone https://github.com/Norgul/git-mirror.git`\nand then enter the repository `cd git-mirror`.\n\n**Note:** running any of commands will create a new `git-mirror`\nfolder at your home directory which will hold bare repositories.\nOnce cloned, they won't be re-downloaded, just updated on each\ncommand run.\n\n## Single repository transfer\nSimply run `./git-mirror.sh PRIMARY SECONDARY` where `PRIMARY`\nis the ful URL to original, main repository. `SECONDARY` is \nthe clone repository which will be overwritten with data from\n`PRIMARY` repo.\n\n## Multiple repository transfer\nIn order to mirror multiple repositories, you need to create \nthe `repos.txt` (or which ever name you'd like to use) file \nwith a pair of space separated repositories, each pair in new line. \nRepositories should be full URL to the repository.\n\nFor example:\n\n```\nhttps://...repo1.git https://...clone1.git\nhttps://...repo2.git https://...clone2.git\nhttps://...repo3.git https://...clone3.git\n```\n\nOnce the file is full, simply run `./repo-mirror.sh /location/to/repos.txt`, and rest\nwill be done automatically.\n\n# Continuous mirroring\nYou can continuously mirror your set of repositories (or just a \nsingle one) by setting up a cron job which will run the script\nperiodically.\n\nFor that to work without user prompt you will need to set passwordless \nssh access. \n\nFirst generate SSH key with no password with `ssh-keygen -t rsa -C \"mail@somewhere.com\"` \nand hit enter twice when it asks for password without entering anything. \n\nAfter that go and enter SSH key to both of your repos and copy the `.pub` from key.\n\nOnce that is done you need to add a `config` file in `.ssh` folder:\n\n```\n# ~/.ssh/config\nHost *hostname*\n    Hostname *hostname*\n    User git\n    IdentityFile ~/.ssh/*your passwordless ssh key (id_rsa if you used default)*\n```\n\nTest the config by doing:\n\n```\ngit clone git@your.hostname.com:username/reponame.git\n```\n\nIf this is successful, you should be okay. \n\n**Note** If you are using 2 different hosts, you will have to make 2 entries in \nSSH config file.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorgul%2Fgit-mirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnorgul%2Fgit-mirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorgul%2Fgit-mirror/lists"}