{"id":15718421,"url":"https://github.com/justintime50/forks-sync","last_synced_at":"2025-03-12T19:33:03.106Z","repository":{"id":46891688,"uuid":"262183621","full_name":"Justintime50/forks-sync","owner":"Justintime50","description":"Keep all your git forks up to date with the remote default branch.","archived":true,"fork":false,"pushed_at":"2024-06-10T23:40:23.000Z","size":102,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-25T06:48:35.120Z","etag":null,"topics":["branch","default","forked","forks","github","main","master","remote","repo","repositories","sync"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Justintime50.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}},"created_at":"2020-05-07T23:55:28.000Z","updated_at":"2024-10-10T22:17:49.000Z","dependencies_parsed_at":"2022-09-02T11:01:39.988Z","dependency_job_id":"558e631a-246b-48e0-8492-9dc1eab73e58","html_url":"https://github.com/Justintime50/forks-sync","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":"0.27586206896551724","last_synced_commit":"25f2e0330522a52418c70ac64d4e7c46b1d8bff5"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justintime50%2Fforks-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justintime50%2Fforks-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justintime50%2Fforks-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justintime50%2Fforks-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Justintime50","download_url":"https://codeload.github.com/Justintime50/forks-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243281497,"owners_count":20266217,"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":["branch","default","forked","forks","github","main","master","remote","repo","repositories","sync"],"created_at":"2024-10-03T21:53:02.197Z","updated_at":"2025-03-12T19:33:02.382Z","avatar_url":"https://github.com/Justintime50.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n\n# Forks Sync\n\nKeep all your git forks up to date with the remote default branch.\n\n[![Build Status](https://github.com/Justintime50/forks-sync/workflows/build/badge.svg)](https://github.com/Justintime50/forks-sync/actions)\n[![Coverage Status](https://coveralls.io/repos/github/Justintime50/forks-sync/badge.svg?branch=main)](https://coveralls.io/github/Justintime50/forks-sync?branch=main)\n[![PyPi](https://img.shields.io/pypi/v/forks-sync)](https://pypi.org/project/forks-sync)\n[![Licence](https://img.shields.io/github/license/justintime50/forks)](LICENSE)\n\n\u003cimg src=\"https://raw.githubusercontent.com/justintime50/assets/main/src/forks-sync/showcase.png\" alt=\"Showcase\"\u003e\n\n\u003c/div\u003e\n\nIf you manage more than a couple git forks, keeping them up to date with their remote default branch can be a pain. Forks Sync lets you avoid all the fuss by concurrently cloning each of your projects locally, adding the remote upstream, fetching new changes, rebasing your local default branch against the remote default branch, and `force pushing` to your repo's origin default branch - keeping all your forks up to date with the original repo.\n\nBy default, Forks Sync will save all your forks to `~/forks-sync` where you can also find logs for this tool.\n\n**This tool will forcefully update the default branch of your fork to match the upstream default branch which could results in loss of changes if they are not committed on default branches.**\n\n## Install\n\n```bash\n# Install tool\npip3 install forks-sync\n\n# Install locally\njust install\n```\n\n## Usage\n\n```text\nUsage:\n    forks-sync --token 123\n\nOptions:\n    -h, --help            show this help message and exit\n    -t TOKEN, --token TOKEN\n                            Provide your GitHub token to authenticate with the GitHub API.\n    -f, --force           Pass this flag to force push changes to forked repos, otherwise the tool will run in \"dry mode\".\n    -th THREADS, --threads THREADS\n                            The number of threads to run.\n    -to TIMEOUT, --timeout TIMEOUT\n                            The number of seconds before a git operation times out.\n    -l LOCATION, --location LOCATION\n                            The location where you want your forks and logs to be stored.\n    --version             show program's version number and exit\n```\n\n### Authentication\n\nThere are two methods of authentication with this tool. The `--token` flag is required in addition to one of the following:\n\n#### SSH\n\nTo allow the script to run continuosly without requiring passwords for every repo, you can add your SSH passphrase to the SSH agent:\n\n```bash\n# This assumes you've saved your SSH keys to the default location\nssh-add\n```\n\nYou can then run a command similar to `forks-sync --token 123` where the token is your GitHub API token. This will authenticate you with the GitHub API via the `token` and with GitHub via `ssh`.\n\n#### Git Credential Manager\n\nAlternatively, you can use a tool like [Git Credential Manager](https://github.com/git-ecosystem/git-credential-manager) to populate your Git credentials under the hood. When not using SSH, we'll clone from the git URLs instead of the SSH URLs. To trigger this behavior, you must pass the `--https` flag.\n\nYou can then run a command similar to `forks-sync --token 123 --https` where the token is your GitHub API token. This will authenticate you with the GitHub API via the `token` and with GitHub via your Git credentials via `GCM`.\n\n## Development\n\n```bash\n# Get a comprehensive list of development tools\njust --list\n\n# Run the tool locally\nvenv/bin/python forks_sync/sync.py\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustintime50%2Fforks-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustintime50%2Fforks-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustintime50%2Fforks-sync/lists"}