Base worktrees on origin/main

Base worktrees on origin/main

git worktree add ../DPF-<topic> -b feat/<branch> origin/main — never main, never HEAD. Local main is often ahead of or behind origin/main due to unpushed commits, in-flight rebases, or merges from other concurrent sessions; basing a new feature branch on local main sweeps that drift into the PR and fails DCO / sign-off checks.

Why this exists

Local main is not a reliable baseline. It can be:

A new worktree branched off local main inherits whichever of those states the local clone happens to be in. The branch is then not what the operator + reviewer think it is, and the resulting PR either:

What to do

When creating a worktree:

git -C D:/DPF fetch origin main --quiet
git -C D:/DPF worktree add D:/DPF-<topic> -b <branch-name> origin/main

Three precise verbs:

  1. fetch origin main first — ensure the local ref of origin/main is fresh
  2. worktree add the worktree directory
  3. Base the new branch on origin/main explicitly (not HEAD, not main)

Verify before claiming done

Per structural-verification-is-not-functional, verify PR-level checks before claiming the work is done. Local “tests pass” is not the same as “the PR’s CI is green.” The PR view itself is the ground truth.

Anti-pattern