You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Worktree reuse silently breaks on Git < 2.36 (git worktree list --porcelain -z fails, all refs lose worktreePath) #12761
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Use a machine with Git < 2.36 (mine: Ubuntu 22.04.3 LTS, stock git 2.34.1; it is the current version in Ubuntu 22.04's repos, so this affects every default 22.04 box).
In a project, leave the main checkout on main and create a worktree: git worktree add ~/wt/feat-x -b feat-x
In T3 Code, start a new thread on that project with Workspace = Current checkout.
Open the branch picker and select feat-x.
Expected behavior
feat-x shows the worktree badge in the picker, and selecting it takes the reuseExistingWorktree path: the thread is bound to ~/wt/feat-x, no git command is run, the workspace chip becomes "Current worktree", and no second worktree is created on send.
Actual behavior
No worktree badge is shown on any branch. Selecting feat-x runs git checkout feat-x in the main checkout, which Git correctly refuses:
Git command failed in GitVcsDriver.switchRef.checkout (<project path>): git checkout failed
The real Git message (fatal: 'feat-x' is already checked out at '<worktree path>') never reaches the user — see "secondary issues" below — so the error looks like a T3 worktree bug rather than a Git version problem.
Impact
Major degradation or frequent failure
Version or commit
0.0.43-nightly.20260920.2005
Environment
Ubuntu 22.04.3 LTS
Logs or stack traces
Git command failed in GitVcsDriver.switchRef.checkout (<project path>): git checkout failed
# what git actually said, obtained by hand:
fatal: 'feat/<branch>' is already checked out at '<home>/.t3/worktrees/<project>/<worktree>'
Screenshots, recordings, or supporting files
No response
Workaround
Upgrade Git to ≥ 2.36 on the machine that hosts the project (verified fixed with Git 2.55.0 from ppa:git-core/ppa; the worktree badges reappear and branch selection binds the thread to the existing worktree with no checkout).
Activity
juliusmarminge commentedon Sep 20, 2026
This matches open PR #12263 (
git worktree list --porcelain -zfallback for Git < 2.36). That PR now hasCloses #12761.Related secondary (opaque git stderr): #4380