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
Worktrees no longer using branch name in version 1.107.0 #283700
Does this issue occur when all extensions are disabled?: Yes
VS Code Version: 1.107.0
OS Version: OS X 26.1
When creating a new worktree, the tree would adopt the name of the branch. When upgrading from 1.106.3 to 1.107.0, worktrees are now named "worktree-{ISO timestamp}". This does not occur when creating a new branch, only when creating a worktree for an existing branch
Steps to Reproduce:
Initialise a new git repo
Create a new branch (xyz)
Create a worktree using the Git menu
The worktree will be called and placed into a folder named worktree-{timestamp}
Steps that won't reproduce:
Initialise a new git repo
Use the create worktree flow to simultaneously create a branch
In the image, the first branch is opening an existing branch, second branch was created when adding the worktree. If I close and reopen it, it'll end up with a similar name
I also moticed a change of behaviour on the worktree creation via the UI.
My workflow used to be:
Repository (ex: my-repo) > Create worktree...
Select the branch (local or remote), ex: feature-01
Select the folder (pre-filled with previous base path + the branch name), ex: ../my-repo.worktrees/feature-01
VS Code / git creates the worktree
Worktree available, ex: at ../my-repo.worktrees/feature-01
After the VS Code recent update (1.107.0), VS Code seems to add the fodler level worktree-{timestamp} and put the worktree there, ex: ../my-repo.worktrees/feature-01/worktree-{timestamp} as well as create a branch worktree-{timestamp} for it.
I have two issue with this new behaviour:
I already selected a branch for the worktree, I don't need another one
In the Repositories view, it's not possible to identify the worktrees anymore, they are all named the same worktree-{timestamp}.
Note: I don't have any extensions related to worktree AFAIK and no git pre-hook.
EDIT: Looks like a bug, the code shows the timestamp syntax is only a fallback if branch is undefined, so the question is why branch is undefined even if one was selected?
One small thing, it seems the worktree path doesn't "stick" when you change it
i.e. by default it's {project}/{project}.worktrees/{branch}, but if I change it to {project}/{branch} it goes back to suggesting the default path on the new worktree. Before it'd offer to create it in the directory the last tree was created
Activity
aurelticot commentedon Dec 16, 2025
I also moticed a change of behaviour on the worktree creation via the UI.
My workflow used to be:
my-repo) > Create worktree...feature-01../my-repo.worktrees/feature-01../my-repo.worktrees/feature-01After the VS Code recent update (1.107.0), VS Code seems to add the fodler level
worktree-{timestamp}and put the worktree there, ex:../my-repo.worktrees/feature-01/worktree-{timestamp}as well as create a branchworktree-{timestamp}for it.I have two issue with this new behaviour:
worktree-{timestamp}.Note: I don't have any extensions related to worktree AFAIK and no git pre-hook.
EDIT: Looks like a bug, the code shows the timestamp syntax is only a fallback if
branchis undefined, so the question is whybranchis undefined even if one was selected?vscode/extensions/git/src/repository.ts
Lines 1797 to 1816 in a24e66c
lszomoru commentedon Dec 16, 2025
This is a regression. I will investigate this today and will try to push a fix that will be available in VS Code Insiders tomorrow.
lszomoru commentedon Dec 16, 2025
A fix for this regression will be available in tomorrow's Insiders release so I would appreciate it you could verify it. Thanks!
jacksen-honey commentedon Dec 17, 2025
Looks fixed, thanks!
jacksen-honey commentedon Dec 17, 2025
One small thing, it seems the worktree path doesn't "stick" when you change it
i.e. by default it's {project}/{project}.worktrees/{branch}, but if I change it to {project}/{branch} it goes back to suggesting the default path on the new worktree. Before it'd offer to create it in the directory the last tree was created
lszomoru commentedon Dec 17, 2025
jacksen-honey, please file a separate issue for that. Thanks!