fix(workflow): wt-new branches with --no-track (no inherited origin/main upstream)
Branching off origin/main set the new branch's upstream to origin/main, so a bare `git push` failed with a name-mismatch and suggested the dangerous `git push origin HEAD:main`. Add --no-track so the branch carries no upstream until the first `git push -u origin <branch>` sets the right one — keeping the fresh-from-origin/main base without the tracking side-effect. Add a test-wt.sh assertion that a new branch has no upstream, and note the behaviour + first-push form in ADR-0059 / CLAUDE.md.
This commit is contained in:
@@ -284,7 +284,8 @@ operational rules an agent must follow:
|
||||
chore/ refactor/ test/ ci/`) matching the commit type.
|
||||
- **One worktree per branch — never switch the primary checkout.** Start a
|
||||
branch with `scripts/wt-new.sh <branch>` (creates branch off `origin/main`
|
||||
+ a sibling `<repo>-worktree-<segment>` worktree); remove a finished one
|
||||
with `--no-track` + a sibling `<repo>-worktree-<segment>` worktree; first
|
||||
push is `git push -u origin <branch>`); remove a finished one
|
||||
with `scripts/wt-rm.sh <branch>` (removes only the *named* worktree — it
|
||||
never scans or auto-removes, so long-lived branches like `website`/`ci`
|
||||
are never at risk). This prevents the same-directory clobber hazard.
|
||||
|
||||
Reference in New Issue
Block a user