Auto-rebase
Auto-rebase is the practice of automatically keeping pull request branches up to date with the target branch without requiring the developer to manually run `git rebase main` or `g
- ·Merge queue is implemented (GitHub merge queue, Mergify, or equivalent)
- ·Auto-rebase is enabled for PRs targeting main branch
- ·CD pipeline includes at least one gate (tests pass, security scan, approval)
- ·Merge conflicts are detected and flagged before review is requested
- ·Deploy frequency is at least daily
Evidence
- ·Merge queue configuration in repository settings or CI
- ·Auto-rebase configuration (branch protection rules, bot configuration)
- ·CD pipeline definition showing gate conditions
What It Is
Auto-rebase is the practice of automatically keeping pull request branches up to date with the target branch without requiring the developer to manually run git rebase main or git merge main on their branch. When main advances - because another PR merged - any open PRs that are behind main are automatically rebased onto the new tip. The developer's branch stays current without any manual intervention.
The technical mechanism varies by implementation. GitHub offers an "Update branch" button (and "Always suggest updating pull request branches" setting) that lets developers rebase with a click. Mergify's queue action and update_branch: true configuration go further, automatically rebasing PRs as soon as they fall behind main. GitHub's merge queue also handles this internally: when a PR enters the queue, it's rebased onto the current queue head automatically.
At L2, auto-rebase is typically implemented at the PR level: when a PR is behind main by more than N commits, a bot rebases it automatically. This prevents the common failure mode where a PR passes CI, gets approved, sits for 24 hours while main advances, and then fails CI when merged because the branch is stale. Without auto-rebase, developers must manually keep their branches current, which is pure overhead with no engineering value.
At higher AI adoption levels, auto-rebase becomes structurally necessary. When agents produce 10-20 PRs per day and each PR might sit in review for hours, the branch drift problem is endemic without automation. An agent-produced PR that was correct when submitted might be incorrect by the time it's reviewed if main has advanced significantly. Auto-rebase ensures the review always reflects the current state.
Why It Matters
- Eliminates "stale branch" failures - a PR that passes CI when opened but fails when merged because main advanced is a source of developer frustration and wasted CI time; auto-rebase makes this impossible
- Reduces review-to-merge latency - developers don't need to manually rebase before merge, which removes a step that typically requires context-switching back to a PR they'd moved on from
- Required for high-throughput merge queues - merge queues that process 50+ PRs/day need each PR to be current before entering the queue; auto-rebase provides this guarantee automatically
- Keeps agent-produced PRs valid - AI-generated PRs can become invalid if main advances and conflicts with the agent's changes; auto-rebase surfaces these conflicts early (when there's time to fix them) rather than at merge time
- Reduces cognitive overhead for developers - "is my branch up to date?" is a question developers shouldn't have to think about; automation removes it from their mental checklist
Getting Started
6 steps to get from here to the next level
Common Pitfalls
Mistakes teams actually make at this stage - and how to avoid them
How Different Roles See It
Bob's team has a recurring pattern: a PR gets approved, but by the time the developer gets around to merging it (after picking up another task while waiting for review), main has advanced and the CI check fails. The developer has to rebase, CI runs again, and the PR might need another review cycle if the rebase introduced anything unusual. This adds 2-4 hours to PR cycle time on average.
What Bob should do - role-specific action plan
Sarah's developer experience data shows "rebase overhead" as a common complaint in retros. Developers describe it as "I had a PR ready to go but had to spend 30 minutes rebasing and resolving conflicts because main moved while I was in a different context." This is invisible in standard metrics but highly visible in developer frustration.
What Sarah should do - role-specific action plan
Victor runs 3-5 parallel agent tasks and each produces a PR. By the time PR #1 is reviewed and merged, the branches for PRs #2-5 are stale. Victor manually rebases them but this is 15-20 minutes of overhead per session that adds no value. He's already mentally moved on from those tasks and rebase is pure friction.
What Victor should do - role-specific action plan
Further Reading
5 resources worth reading - hand-picked, not scraped
From the Field
Recent releases, projects, and discussions relevant to this maturity level.
Merge & Deploy