git-multi
A CLI tool for managing multiple Git remotes and syncing content between them. git-multi simplifies workflows where you need to keep multiple remotes in sync, cherry-pick changes across different upstream repositories, or manage complex multi-remote branch structures.
Features
- Multi-Remote Management: Easily add, rename, and track multiple Git remotes.
- Cross-Remote Syncing: Sync branches and cherry-pick commits between different remotes.
- Unified Branch View: See local and remote branches across all configured remotes in one view.
- File Portability: Copy specific files between different branches or remotes without full merges.
- PR Integration: Quick Pull Request creation using the
ghCLI. - Default Remotes: Set a default remote for streamlined commands.
Installation
Usage
GUI Mode
Launch the terminal user interface:
The GUI is a three-panel terminal UI: Remotes | Branches | Details, with the Details panel doubling as a live Status view. The remote and branch lists auto-refresh in real time (every ~200ms), so changes made inside or outside the app show up immediately.
Navigation & global keys:
Tab(or←/→) — switch focus between the Remotes and Branches panels↑/↓— move the selection within the focused panelSpace— toggle multi-select of a branch (branches show[x]/[ ])f/Enter— fetch the selected remote (+ selected branches)p— push,l— pull the selected remote (+ selected branches)M— merge across remotes (4-step flow: source remote, source branch, dest remote, dest branch)v— toggle Commits view in the Details panelC— create a commit (select type, enter subject, optional body)s— toggle the Status view (remotes, local branches, working tree)r— force refresh,q— quit
Remote actions (when the Remotes panel is focused):
a— add a remote (name, then URL)R— rename the selected remotex/Delete— remove the selected remote (confirm withy)D— set the selected remote as default
Branch actions (when the Branches panel is focused):
c— create a branch (name, base, optional remote to push to)m— rename the selected branchx/Delete— delete the selected local branch (confirm withy)
With no branch selected, fetch/pull target all branches and push targets the current branch.
Merge (GUI, M): A 4-step interactive flow:
- Source remote (e.g.,
upstream) - Source branch (e.g.,
main) - Destination remote (e.g.,
origin) - Destination branch (e.g.,
main)
Commits (GUI, v): View recent commits in the Details panel.
Create Commit (GUI, C): A 3-step flow for conventional commits:
- Select type (
feat,fix,docs,style,refactor,test,chore,build,perf) - Enter commit subject
- Optional body (press Enter to skip)
The GUI runs the same git subprocesses as the CLI, so it honours your
~/.ssh/confighost aliases (e.g.github.com-personal).
Initialization
Initialize git-multi in your current Git repository:
Remote Management
# Add a new remote
# List all configured remote names
# Set a default remote
# Set a primary remote
# Rename a remote
# Remove a remote
# List all remotes
Branch Management
# List all local and remote branches
# Create a new branch locally
# Create a new branch locally and on multiple remotes
# Rename a local branch
# Delete a local branch
Syncing and Moving Content
# Sync changes from one remote branch to another
# Copy specific files from another branch
Merging across remotes
Merge a branch from one remote into the current local branch, optionally pushing the result to another remote:
# Merge upstream/main into the current branch
# Merge and push the result to origin
Standard Git Operations (Enhanced)
# Fetch from all remotes
# Fetch from a specific remote (the current branch is used for push/pull)
# Fetch specific branches from a remote
# Fetch every branch of a remote
# Push current branch to all remotes
# Push current branch to a specific remote
# Push multiple branches to a specific remote
# Push every local branch to a specific remote (optionally --force)
# Pull into the current branch from a specific remote
# Pull multiple branches from a specific remote
# Pull every branch of a remote
Configuration
git-multi stores its configuration in .gitmulti/config.toml within your repository. This file tracks default remotes, sync preferences, and metadata for each remote.
License
MIT