Skip to content

detached-head

branch

HEAD detached at main~2, worktree clean

HEAD is detached at `main~2`. The `main` branch still exists at
its original tip — only HEAD has moved off it.

Useful for testing:
  - detached-HEAD banners / warnings in TUIs
  - "make this a branch?" affordances
  - status-bar branch indicators when there's no current branch
  • HEAD is detached
  • main still exists as a branch
  • main has 4 commits
  • HEAD is 2 commits behind main
  • worktree is clean
detached-headedge-case
(HEAD detached at 1ab1c9c)main
import { spinUpScenario } from '@gfargo/git-scenarios'

const repo = await spinUpScenario('detached-head')
* 34c4535 (main) feat: three
* 3c9536f feat: two
* 1ab1c9c (HEAD) feat: one
* 7520170 chore: initial

Back to Scenario Browser