import DocCardList from '@theme/DocCardList';

# Rebasing and Stacked Branch Answers

_Fixes for rebasing stacked branches, squash merges and keeping dependent branches current._

A [stack](/learn/concepts/git/stacked-prs) is a chain of branches where each one builds on the one below. Rebasing a stack by hand is where most of the pain is. Each answer below covers one situation.

With Git 2.38 or newer, [rebasing a whole stack with --update-refs](./rebasing-and-stacks/git-rebase-update-refs.md) moves every branch in one command. If the bottom branch was squash merged, [rebase the next branch with --onto](./rebasing-and-stacks/rebase-stack-after-squash-merge.md) instead. The [Stacked PR Workflow](/learn/workflows/git/stacked-pr) shows the review cycle around these fixes.
