<div align="center">
# Forks Sync
Keep all your git forks up to date with the remote default branch.
[![Build Status](https://github.com/Justintime50/forks-sync/workflows/build/badge.svg)](https://github.com/Justintime50/forks-sync/actions)
[![Coverage Status](https://coveralls.io/repos/github/Justintime50/forks-sync/badge.svg?branch=main)](https://coveralls.io/github/Justintime50/forks-sync?branch=main)
[![PyPi](https://img.shields.io/pypi/v/forks-sync)](https://pypi.org/project/forks-sync)
[![Licence](https://img.shields.io/github/license/justintime50/forks)](LICENSE)
<img src="https://raw.githubusercontent.com/justintime50/assets/main/src/forks-sync/showcase.png" alt="Showcase">
</div>
If 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.
By default, Forks Sync will save all your forks to `~/forks-sync` where you can also find logs for this tool.
**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.**
## Install
```bash
# Install tool
pip3 install forks-sync
# Install locally
just install
```
## Usage
```text
Usage:
forks-sync --token 123
Options:
-h, --help show this help message and exit
-t TOKEN, --token TOKEN
Provide your GitHub token to authenticate with the GitHub API.
-f, --force Pass this flag to force push changes to forked repos, otherwise the tool will run in "dry mode".
-th THREADS, --threads THREADS
The number of threads to run.
-to TIMEOUT, --timeout TIMEOUT
The number of seconds before a git operation times out.
-l LOCATION, --location LOCATION
The location where you want your forks and logs to be stored.
--version show program's version number and exit
```
### Authentication
There are two methods of authentication with this tool. The `--token` flag is required in addition to one of the following:
#### SSH
To allow the script to run continuosly without requiring passwords for every repo, you can add your SSH passphrase to the SSH agent:
```bash
# This assumes you've saved your SSH keys to the default location
ssh-add
```
You 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`.
#### Git Credential Manager
Alternatively, 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.
You 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`.
## Development
```bash
# Get a comprehensive list of development tools
just --list
# Run the tool locally
venv/bin/python forks_sync/sync.py
```
Raw data
{
"_id": null,
"home_page": "http://github.com/justintime50/forks-sync",
"name": "forks-sync",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8, <4",
"maintainer_email": "",
"keywords": "",
"author": "Justintime50",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/80/62/4c0bf7943da517eaee695eedfd536b619ce083ada72530776b6e638ecc0e/forks-sync-4.2.2.tar.gz",
"platform": null,
"description": "<div align=\"center\">\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<img src=\"https://raw.githubusercontent.com/justintime50/assets/main/src/forks-sync/showcase.png\" alt=\"Showcase\">\n\n</div>\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",
"bugtrack_url": null,
"license": "MIT",
"summary": "Keep all your git forks up to date with the remote default branch.",
"version": "4.2.2",
"project_urls": {
"Homepage": "http://github.com/justintime50/forks-sync"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5f879cdbad86f79d9f8a188eb19677b38805c30b47c1ce832d62e59f64d0add9",
"md5": "16053676cd48ff35160b8c4f66c46c30",
"sha256": "6e2edbd83f3878eb2228b591d696de1a81f01a90ac2d88b40358ea4d826a80e9"
},
"downloads": -1,
"filename": "forks_sync-4.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "16053676cd48ff35160b8c4f66c46c30",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8, <4",
"size": 7589,
"upload_time": "2023-08-28T04:00:17",
"upload_time_iso_8601": "2023-08-28T04:00:17.985471Z",
"url": "https://files.pythonhosted.org/packages/5f/87/9cdbad86f79d9f8a188eb19677b38805c30b47c1ce832d62e59f64d0add9/forks_sync-4.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "80624c0bf7943da517eaee695eedfd536b619ce083ada72530776b6e638ecc0e",
"md5": "006c99102a150e026d9bb2df8cd52590",
"sha256": "1c09ee4c938279058afdb15d023da1a5870fd6919b2be790406e9ba7b79bf3bd"
},
"downloads": -1,
"filename": "forks-sync-4.2.2.tar.gz",
"has_sig": false,
"md5_digest": "006c99102a150e026d9bb2df8cd52590",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8, <4",
"size": 8372,
"upload_time": "2023-08-28T04:00:19",
"upload_time_iso_8601": "2023-08-28T04:00:19.439642Z",
"url": "https://files.pythonhosted.org/packages/80/62/4c0bf7943da517eaee695eedfd536b619ce083ada72530776b6e638ecc0e/forks-sync-4.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-28 04:00:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "justintime50",
"github_project": "forks-sync",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "forks-sync"
}