Worktree merge commit to main
Problem
main may already be checked out in another worktree, and that worktree may be dirty or far behind. A direct checkout from the feature worktree fails because Git prevents one branch from being checked out by multiple worktrees.
Solution
From the clean feature worktree, fetch remote refs and create a temporary integration branch from origin/main. Merge the feature branch there with --no-ff, run validation, sync issue metadata, then push the merge commit directly to main with git push origin HEAD:main.
After push, verify origin/main points at the merge commit, switch back to the feature branch, and delete the temporary integration branch.
Anti-Pattern
Do not force checkout main over an existing worktree, and do not merge inside a dirty primary worktree. Avoid destructive worktree cleanup unless explicitly requested.
Context
The mouse-first TUI work was merged while the primary main worktree had untracked project files and was behind remote. The safe path used a temporary branch from origin/main, validated the merge commit, pushed HEAD:main, and restored the feature worktree.