SDF Documentation

SDF (Stacked Diffs Flow) is a CLI tool for managing stacked pull requests in GitHub repositories. It automates cascade rebasing, keeps PR bases in sync, and provides context-aware AI conflict resolution through Claude.

Quick links

  • Why SDF — What stacked diffs solve, how SDF compares to alternatives, and whether it's the right fit for your team.
  • Getting Started — Build and sync your first stacked PR chain in under five minutes.
  • What Are Stacked Diffs? — A practical explanation of stacked pull requests, why teams use them, and how SDF automates the maintenance work.
  • Installation — Install SDF on macOS, Linux, or Windows.
  • Core Concepts — Stacks, nodes, and how SDF models your PR chains.
  • Commands — Full reference for every sdf command.
  • Configuration — Two-tier configuration for repos and individual users.
  • AI Features — How SDF uses Claude for branch splitting, conflict resolution, and PR content generation.
  • Sync Deep Dive — How sdf sync works -- cascade rebase, reconciliation, conflict resolution, and PR updates.
  • Splitting Branches — How to use sdf split to decompose a large branch into a stack of focused PRs.
  • Multiple Stacks — Managing several independent stacks in a single repository.
  • Fetching & Reconciliation — How to import existing PR stacks from GitHub and keep local state in sync.
  • JSON Output & Scripting — Using sdf's --json flag for automation, CI pipelines, and AI agent integration.
  • Troubleshooting — Common errors, recovery procedures, and how to get unstuck.
  • Moving Commits — How to use sdf move to relocate commits from the current branch to its parent.

New here? Start with Why SDF.