A Terminal User Interface (TUI) tool for managing downstream forks and keeping them synchronized with actively-maintained upstream repositories.
rbt helps teams maintain downstream forks by tracking which patches need to be carried forward during rebases. It provides a visual interface to see which downstream commits are present or missing on your current rebase branch, making it easier to ensure all necessary patches are applied.
- Visual Commit Tracking: See all downstream patches and their status at a glance
- Commit Categorization: Automatically identifies carry, drop, and pending upstream commits
- Rebase Assistant: Track which commits are present or missing on your rebase branch
- Configurable: Customize upstream and downstream branch names
- In-Progress Rebase Updater: Helps you bring a currently in-progress rebase up to date with new revisions of upstream tags or downstream branches
This tool attempts to codifiy preexisting processes and disparate scripts into one package. AI was involved in doing so, especially with regards to TUI/display logic. You have been appropriately warned.
rbt recognizes commits in your downstream fork that follow these prefixes:
-
UPSTREAM: <carry>:- Patches that should be carried forward indefinitely. These are downstream-specific changes that won't be adopted upstream.Example:
UPSTREAM: <carry>: Add custom authentication middleware -
UPSTREAM: <drop>:- Commits that should not be carried forward. Typically used for generated files that will be regenerated later.Example:
UPSTREAM: <drop>: Update generated API documentation -
UPSTREAM: 12345:- Pull requests opened upstream but not yet merged. The number represents the upstream PR number on GitHub.Example:
UPSTREAM: 12345: Fix memory leak in connection pool
When a PR is merged upstream, you can drop the corresponding downstream commit since it will come in through the upstream sync.
- Go 1.21 or later
- Clone the repository:
git clone <repository-url>
cd rbt- Build the application:
make build- (Optional) Install globally:
make installRun the application from the project directory:
./rbtOr if installed globally:
rbtCreate a .rbt file in your repository root:
cp .rbt.example .rbtEdit .rbt to configure your upstream and downstream branches:
git:
upstream_branch: "upstream-master" # Your upstream remote branch
downstream_branch: "downstream-master" # Your downstream master branchNote: rbt automatically detects the most recent merge commit using git log HEAD ^downstream-master --merges --oneline to use as the base for presence checking. This ensures commits are only considered PRESENT if they exist after your most recent rebase/merge.
You can also specify a custom configuration file location:
rbt --config /path/to/config.yaml-
Start from the upstream branch you'd like to rebase from:
git checkout v1.35
-
Create a rebase branch:
git checkout -b rebase-1.35
-
Use the "ours" strategy to create a merge commit:
git merge -s ours downstream-master
-
Run rbt to see commit status:
rbt
-
View shows two columns:
- Left: Commits with
UPSTREAM:prefix from downstream and current branch - Right: Status indicating commit state:
✓ PRESENT- Commit from downstream is on current branch✗ MISSING- Commit from downstream is NOT on current branch+ NEW- Commit on current branch that wasn't in downstream
- Left: Commits with
-
Compare commits side-by-side:
- Press
Enteron anyPRESENTcommit to open a comparison view - See the commit from downstream on the LEFT and current branch on the RIGHT
- Verify your rebased version matches or improves upon the downstream version
- Both sides scroll together to keep comparisons aligned
- Press
-
Cherry-pick or apply missing commits as needed during your rebase process.
The tool helps you ensure all necessary downstream patches are applied to your rebase branch, and shows you any new UPSTREAM commits you've added.
The update rebase feature helps you bring a currently in-progress rebase up to date with new revisions of upstream tags or downstream branches. This is useful when:
- A new upstream version/tag is released while you're working on a rebase
- Your downstream branch has been updated with new patches
- You want to rebase your work onto a newer base
Press u in the commit list view to open the update rebase form, which will:
- Collect all UPSTREAM commits from your current branch
- Switch to a new upstream tag (e.g., a newer version)
- Create a new rebase branch from that tag
- Merge your downstream branch using the "ours" strategy to establish ancestry
- Cherry-pick all UPSTREAM commits from your current branch onto the new base
-
From the commit list, press
uto open the update rebase form -
Fill in the form:
- New branch name: Name for your updated rebase branch (e.g.,
rebase-v2.1.0) - Upstream tag: The new upstream version to rebase onto (e.g.,
v2.1.0) - Downstream branch: The downstream branch to merge for ancestry (typically your configured downstream branch)
- New branch name: Name for your updated rebase branch (e.g.,
-
Press Enter to start the automated rebase process
-
Monitor progress: The progress view shows:
- Current phase of the rebase
- Progress bar for cherry-picking commits
- Recent activity log
- Any conflicts that need resolution
-
Handle conflicts: If a cherry-pick conflict occurs:
- The rebase pauses automatically
- Resolve conflicts in your editor
- Press Enter to continue
- The rebase resumes from where it paused
The update rebase process creates a state file (.rbt-rebase-<branch-name>.json) that tracks:
- Which commits have been cherry-picked
- Which commits had conflicts that were resolved
- Current progress through the commit list
q,Ctrl+C: Quit the application?,h: Show help↑/↓orj/k: Navigate commit listg/G: Jump to top / bottom of listEnter: Compare commitu: Open update rebase formr: Refresh commit status
↑/↓orj/k: Scroll both sides togetherg/G: Jump to top / bottomPgUp/PgDn: Page up / downEscorq: Return to commit list
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Apache 2.0



