{"id":20727820,"url":"https://github.com/plippe/github-fork-sync","last_synced_at":"2025-09-15T06:28:27.606Z","repository":{"id":151296718,"uuid":"78297474","full_name":"plippe/github-fork-sync","owner":"plippe","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-29T20:48:46.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T23:43:59.544Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plippe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":"plippe"}},"created_at":"2017-01-07T18:55:40.000Z","updated_at":"2022-09-29T21:10:39.000Z","dependencies_parsed_at":"2023-04-14T15:46:44.052Z","dependency_job_id":null,"html_url":"https://github.com/plippe/github-fork-sync","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plippe%2Fgithub-fork-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plippe%2Fgithub-fork-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plippe%2Fgithub-fork-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plippe%2Fgithub-fork-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plippe","download_url":"https://codeload.github.com/plippe/github-fork-sync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243005234,"owners_count":20220442,"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":[],"created_at":"2024-11-17T04:34:19.077Z","updated_at":"2025-03-11T09:23:37.059Z","avatar_url":"https://github.com/plippe.png","language":"Python","funding_links":["https://github.com/sponsors/plippe"],"categories":[],"sub_categories":[],"readme":"# GitHub fork sync\n\n\u003e A fork is a copy of a repository. Forking a repository allows you to freely\n\u003e experiment with changes without affecting the original project.\n\u003e\n\u003e ...\n\u003e\n\u003e You might fork a project in order to propose changes to the upstream, or\n\u003e original, repository. In this case, it's good practice to regularly sync your\n\u003e fork with the upstream repository. To do this, you'll need to use Git on the\n\u003e  command line. You can practice setting the upstream repository using the\n\u003e same octocat/Spoon-Knife repository you just forked!\n\u003e\n\u003e -- *[GitHub][1]*\n\nWho has the time to manually sync their forks ? Don't waste time, automate this.\n\n### GitHub token\nFirst, you need a [GitHub token][2] to use their API. The token requires the\n*repo* scope (Full control of private repositories). Store it and don't lose it.\n\n### Run as a script\n```\nexport GITHUB_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n\npython github_fork_sync.py --help\npython github_fork_sync.py $UPSTREAM $FORK\n```\n\nDon't hesitate to add this as a cron job to have the sync run periodically.\n\n### Run as an AWS Lambda\n```\n./aws/cloudformation.sh\n\n# Create the stack\n./aws/cloudformation.sh create $S3_BUCKET $S3_KEY $GITHUB_TOKEN\n\n# Add repos to sync\n./aws/cloudformation.sh add-sync $UPSTREAM1 $FORK1 $BRANCH1\n./aws/cloudformation.sh add-sync $UPSTREAM2 $FORK2 $BRANCH2\n./aws/cloudformation.sh add-sync $UPSTREAM3 $FORK3 $BRANCH3\n\n# Delete the stack\n./aws/cloudformation.sh delete $S3_BUCKET $S3_KEY\n```\n\nThe lambda will be triggered daily for each repo.\n\n\n[1]: https://help.github.com/articles/fork-a-repo/\n[2]: https://help.github.com/articles/creating-an-access-token-for-command-line-use/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplippe%2Fgithub-fork-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplippe%2Fgithub-fork-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplippe%2Fgithub-fork-sync/lists"}