https://github.com/ackkerman/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.
https://github.com/ackkerman/gh-sync
codex git github github-cli-extension
Last synced: 4 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/ackkerman/gh-sync
- Owner: ackkerman
- License: mit
- Created: 2025-07-16T13:48:23.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-08-11T03:16:45.000Z (9 months ago)
- Last Synced: 2025-08-11T05:25:07.657Z (9 months ago)
- Topics: codex, git, github, github-cli-extension
- Language: Rust
- Homepage:
- Size: 104 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```bash
cargo install --path .
```
Or install as a GitHub CLI extension:
```bash
gh extension install ackkerman/gh-sync
```
## Usage
```bash
# 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