Skip to content

Synchronize a subdirectory of your repository with an external repository using a simple GitHub CLI extension. gh-sync wraps git subtree so that you can easily pull and push changes while keeping track of the mapping in your Git configuration.

License

Notifications You must be signed in to change notification settings

ackkerman/gh-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gh-sync

Synchronize a subdirectory of your repository with an external repository using a simple GitHub CLI extension. gh-sync wraps git subtree so that you can easily pull and push changes while keeping track of the mapping in your Git configuration.

Features

  • connect – register a subdirectory ↔ remote URL mapping
  • pull – fetch from the remote and update the subtree (supports -m for merge message)
  • push – push local changes in the subtree back to the remote (supports -m for commit message)
  • list – show current mappings
  • remove – delete a mapping

These commands make it straightforward to synchronize only a portion of a large repository with another repository.

Installation

Install locally using Cargo:

cargo install --path .

Or install as a GitHub CLI extension:

gh extension install ackkerman/gh-sync

Usage

# Register a mapping (once)
gh sync connect web-app git@github.com:ackkerman/nlo.git --branch dev_ui

# Pull updates from the remote (customize merge message with -m)
gh sync pull web-app -m "Update from remote"

# Push local changes back
gh sync push web-app -m "Sync subtree"

# View mappings
gh sync list

# Remove a mapping
gh sync remove web-app

Mappings are stored in your repository's Git configuration under the gh-sync prefix. Multiple subdirectories can be managed.

License

MIT

About

Synchronize a subdirectory of your repository with an external repository using a simple GitHub CLI extension. gh-sync wraps git subtree so that you can easily pull and push changes while keeping track of the mapping in your Git configuration.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •