command
module
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Jul 4, 2025
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
gh-sync
GitHub CLI Extension to sync your fork with its upstream repository.
Features
- Automatically detects the parent repository
- Adds upstream remote if not present
- Fetches and merges the latest changes from upstream
- Pushes the changes to your fork
- Colored output for better visibility
Installation
gh extension install him0/gh-sync
Usage
gh sync
This will:
- Check if the current directory is a git repository
- Get the parent repository information
- Add upstream remote if not present
- Fetch from upstream
- Merge upstream's default branch (main/master) into your current branch
- Push to origin
Example
$ cd my-forked-repo
$ gh sync
Parent repository: original-owner/original-repo
Upstream already configured: https://github.com/original-owner/original-repo.git
Fetching from upstream...
Default branch: main
Merging upstream/main...
Pushing to origin...
✓ Successfully synced with upstream
Requirements
- GitHub CLI (gh) must be installed and authenticated
- Git must be installed
- The current directory must be a git repository that is a fork
Notes
- The extension will warn you if you're not on the main/master branch
- If merge conflicts occur, you'll need to resolve them manually
- The extension uses the default branch of the upstream repository (main or master)
License
MIT
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.