Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Spread

Git Spread propagates a branch, commits, or pull request commits to multiple Git branches.

Licensed under the MIT License.

It is intentionally stateless:

  • It runs in the current Git working tree.
  • It does not create worktrees or write state/history files.
  • It does not retry or resume failed operations.
  • It stops at the first failure so you can inspect and handle the working tree yourself.
  • Git commands and their output are printed directly in the terminal.

Requirements

  • Git
  • Go 1.26 or newer when building from source
  • GitHub authentication when reading pull requests

Install

macOS

curl -fsSL https://raw.githubusercontent.com/liyown/git-spread/main/scripts/install.sh | sh

Linux

curl -fsSL https://raw.githubusercontent.com/liyown/git-spread/main/scripts/install.sh | sh

The Linux installer automatically selects a .deb or .rpm package and supports x64 and ARM64.

Windows

Run PowerShell as Administrator:

irm https://raw.githubusercontent.com/liyown/git-spread/main/scripts/install.ps1 | iex

To install a specific release instead of the latest version:

curl -fsSL https://raw.githubusercontent.com/liyown/git-spread/main/scripts/install.sh | VERSION=v0.3.0 sh
$env:VERSION='v0.3.0'; irm https://raw.githubusercontent.com/liyown/git-spread/main/scripts/install.ps1 | iex

To build from source:

go install github.com/liyown/git-spread/cmd/git-spread@latest

The executable is named git-spread; Git also exposes it as git spread when it is on PATH.

Portable executables are published with each release:

Platform Artifact
macOS universal git-spread_<version>_darwin_universal.tar.gz
Linux x64 git-spread_<version>_linux_amd64.tar.gz
Linux ARM64 git-spread_<version>_linux_arm64.tar.gz
Windows x64 git-spread_<version>_windows_amd64.zip
Windows ARM64 git-spread_<version>_windows_arm64.zip

Usage

Run without arguments to propagate the current branch:

git spread

Git Spread shows local branches ordered by recent activity. Use the arrow keys and space to select one or more targets, then press Enter.

The same selector appears whenever --to is omitted:

git spread branch develop
git spread commit abc123
git spread pr 123

For scripts and non-interactive use, pass targets explicitly:

git spread branch develop --to release/1.0,release/1.1,main
git spread commit abc123 def456 --to release/1.0
git spread commit main..feature/login-fix --to release/1.0
git spread pr 123 --to release/1.0

Code Statistics

Summarize code changes by commit author. In a terminal, Git Spread prompts for the date range:

git spread stats

For scripts, select a preset or custom inclusive dates explicitly:

git spread stats --period 7d
git spread stats --period 30d
git spread stats --period this-month
git spread stats --period last-month
git spread stats --since 2026-06-01 --until 2026-06-30

Statistics are grouped by author email and include commits, files, inserted lines, deleted lines, net lines, and binary-file count. Date ranges use the Git committer date, and merge commits are excluded.

Use --remote . to apply changes locally without fetching or pushing:

git spread branch develop --to release/1.0 --remote .

Preview an operation without changing branches:

git spread plan branch develop --to release/1.0,main
git spread plan commit abc123 --to release/1.0

Failure Behavior

Before execution, Git Spread requires a clean working tree. During execution it stops immediately if checkout, merge, cherry-pick, or push fails. It does not record recovery metadata or run another target.

If Git leaves a merge or cherry-pick in progress, resolve or abort it with normal Git commands. Once handled, invoke Git Spread again and select the remaining targets yourself.

Commands

Command Purpose
git spread Propagate the current branch with interactive target selection
git spread branch [source] Merge a source branch into selected targets
git spread commit <sha-or-range>... Cherry-pick commits into selected targets
git spread pr <number-or-url> Propagate commits from a GitHub pull request
git spread stats Summarize code changes by author and date range
git spread plan ... Print the resolved operation without executing it
git spread examples Print command examples
git spread completion <shell> Print completion for Bash, Zsh, or Fish
git spread update Print the online update command

Common options:

Option Meaning
--to branch1,branch2 Explicit targets; skips interactive selection
--remote origin|. Remote to fetch/push, or . for local-only execution

Build And Test

go test ./...
go build ./cmd/git-spread

About

A TUI for spreading Git branches, commits, and PRs across release branches.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages