gh-sync

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2025 License: MIT Imports: 6 Imported by: 0

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:

  1. Check if the current directory is a git repository
  2. Get the parent repository information
  3. Add upstream remote if not present
  4. Fetch from upstream
  5. Merge upstream's default branch (main/master) into your current branch
  6. 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

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL