Skip to content

Team conventions for git worktrees

Use conventions that keep worktree names and cleanup behavior predictable.

  • feature/<topic> for feature work
  • fix/<topic> for bug fixes
  • chore/<topic> for maintenance

Commit the shared default source branch to .worktree.yml at the repository root, so every clone agrees without any setup:

defaultSourceBranch: origin/main

See Project Configuration for the file and its other team keys. A person can still set their own with worktree config defaultSourceBranch origin/develop, which overrides the file.

Run periodic cleanup:

Terminal window
worktree cleanup