An open API service indexing awesome lists of open source software.

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.

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