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:
@@ -74,7 +74,10 @@ directory is how work gets clobbered — worktrees make that impossible.
|
||||
Helpers:
|
||||
|
||||
- **`scripts/wt-new.sh <branch>`** — fetch `main`, create the branch off
|
||||
`origin/main`, and add the sibling worktree; prints its path.
|
||||
`origin/main` (with `--no-track`, so it doesn't inherit `origin/main` as
|
||||
upstream — otherwise a bare `git push` errors on the name mismatch and
|
||||
suggests the dangerous `HEAD:main`), and add the sibling worktree; prints
|
||||
its path. First push is `git push -u origin <branch>`.
|
||||
- **`scripts/wt-rm.sh <branch>`** — remove the worktree for the **named**
|
||||
branch, and nothing else. It does **not** scan for "merged" worktrees to
|
||||
auto-remove: long-lived branches (`website`, the `ci` line) are merged
|
||||
|
||||
Reference in New Issue
Block a user