fix: always branch new worktrees from remote-tracking refs#100
Merged
Conversation
When creating a new worktree with a remote-tracking start point (e.g. origin/main), fetch the latest from the remote first so the branch starts from the up-to-date remote tip rather than a potentially stale local copy. The fetch is best-effort — if it fails (e.g. offline), the worktree is still created from whatever the local ref points to.
detect_default_branch now always returns the remote-tracking form (e.g. origin/main) instead of falling back to local branch names. This ensures new worktrees start from the remote tip rather than the local HEAD, which may be behind. When origin/main is not yet in the local ref list (e.g. never fetched), create_worktree will fetch before branching, so returning the origin/ form is safe.
wesbillman
approved these changes
Feb 13, 2026
taylorkmho
added a commit
that referenced
this pull request
Feb 13, 2026
* origin/main: fix: surface worktree setup errors instead of showing infinite spinner (#106) feat: store data in platform-conventional directories (XDG) (#104) feat(notes): add copy-to-clipboard button in NoteModal (#103) feat: add use github repo based projects to avoid cloning when using remote branches (#102) fix: always branch new worktrees from remote-tracking refs (#100) fix: remove debug console.log statements from BranchCard (#97) feat: improve PR button UX with push support and conditional visibility (#89)
loganj
added a commit
that referenced
this pull request
Feb 26, 2026
* feat: CLI `penpal open` subcommand opens files in desktop app - Add `penpal open <path>...` subcommand with routing (unknown commands error) - Replace `openBrowser()` with `openApp()` targeting Penpal.app - Launch desktop app (instead of bare server) when no instance is running - Add SSE `navigate` event broadcast from /api/open for live navigation - Add /api/navigate endpoint for pending navigation on SSE reconnect - Frontend Layout listens for navigate events and polls on reconnect - Go unit tests for /api/navigate (empty, set-by-open, consumed) - Playwright e2e tests for open -> navigate round-trip Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: discover sidecar port dynamically after launching desktop app Poll ReadPortFile() instead of assuming a hardcoded port when no server is already running. Falls back to portFlag for backwards compatibility. Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New branches now always start from the remote tip (e.g.
origin/main) instead of a potentially stale local ref.Changes
detect_default_branch– always returns theorigin/<branch>form, even when only a local ref is present, so new worktrees are never based on an outdated local HEAD.create_worktree– when the start point is a remote-tracking ref, performs a best-effortgit fetchof that ref before creating the worktree, ensuring the branch starts from the real remote tip.