Skip to content

branch-diverged

branch

main is 2 ahead AND 2 behind origin/main, worktree clean

`main` has diverged from `origin/main` — both sides have commits
the other doesn't. The merge base is `HEAD~2` on the local side.

Useful for testing:
  - "diverged" warning rendering (pull --rebase / merge prompts)
  - ahead/behind dual counts in branch lists
  - conflict-aware sync workflows
  • main is checked out
  • main has 4 commits
  • main is 2 ahead and 2 behind origin/main
  • main tracks origin/main
  • worktree is clean
upstreamtrackingdivergedremote
main
import { spinUpScenario } from '@gfargo/git-scenarios'

const repo = await spinUpScenario('branch-diverged')
* a64cf51 (HEAD -> main) local N
* 3d6bc88 local M
| * 6b28d74 (origin/main) upstream Y
| * 2b2b356 upstream X
|/  
* e657666 feat: shared baseline
* 7520170 chore: initial

Back to Scenario Browser