--worktree <PR> creates branch with no upstream tracking — `git push` fails
Resolved 💬 2 comments Opened Mar 12, 2026 by MidnightDesign Closed Apr 10, 2026
When opening a worktree from a PR using claude --worktree '#123' or claude --worktree <PR-URL>, Claude Code:
- Fetches the PR head via
git fetch origin pull/123/head - Creates a new branch
worktree-pr-123atFETCH_HEAD - Does not configure any upstream tracking
As a result, git push fails with "no upstream branch". To update the PR you have to know and manually specify the original branch name, e.g. git push origin HEAD:the-original-branch.
Expected behavior: When creating a worktree from a PR, the branch should have its upstream set to the PR's source branch so git push works naturally.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗