Reproduction steps
- Open a Git repository in Zed with a local main branch and a remote default branch origin/main.
- Check out local main and create a commit without pushing it, so local main and origin/main point to different commits.
- Open the worktree picker using the title-bar button or the git: worktree action.
- Try to create a worktree based on local main, including its unpushed commits.
The picker visibly offers only “Create new worktree based on origin/main”; the active main worktree is listed below it. There is no corresponding creation option based on local main.
Current vs. Expected behavior
Current: The picker hides the current-branch creation target when its branch name matches the remote default branch name. Local main is therefore unavailable as a creation base even when it contains commits absent from origin/main.
Expected: Allow creation from the current local branch when it differs from the remote-tracking default branch. Matching branch names do not imply matching commits. Always offering both targets, or suppressing the local target only when their commit IDs match, would avoid losing this choice.
The documentation says the picker can create a linked worktree from either the current branch or the default branch: https://zed.dev/docs/git#git-worktrees
Relevant implementation
Source inspected at commit 37faef81f74fc1bb08be9939c4cffc8ede6ced2f:
worktree_create_targets() compares current_branch_name with default_branch.branch_name and adds CurrentBranch only when those names differ. It does not compare commit IDs. Thus main versus origin/main suppresses the local target regardless of whether their histories differ. This is a source-based diagnosis; no patched build was tested.
Workaround
Create the worktree from the terminal with an explicit local base:
git worktree add -b my-feature ../my-feature mainZed version and system specs
Zed 1.25.3 (installed application CLI version) OS: macOS 27.2
Logs and settings
No logs or private settings included; the issue concerns the visible picker options and the branch-name comparison above.
I reproduced this in Zed Nightly 1.27.0 (bundle build
20261028.024048) on macOS 15.8.1 arm64, using a local-only Git origin and clone.With local
mainone commit ahead oforigin/main, the picker offered only “Create new worktree based on origin/main”. The checked “main worktree” row showed the local commit, but was not a creation target. I expected a localmaincreation choice so the new worktree could include the unpushed commit.Reproduction steps
Create a disposable fixture:
Open the clone in Zed and run
git: worktree. Dismiss the picker, rungit switch -c local-base-control, and reopen it. Then repeat aftergit switch main.On
local-base-controlat the identical commit, bothorigin/mainandlocal-base-controlappeared as creation targets. Switching back tomainremoved the local creation choice again.origin/mainstayed unchanged throughout.I also verified the workaround
git worktree add -b workaround ../workaround main: the new worktree started at the local tip, including the unpushed commit. I did not test a patched build.Picker comparison
Same local commit in both screenshots. Local paths are redacted.