microsoft / microsoft/vscode-remote-release
Experimental worktree support doesn't work when workspaceMount is customized
@chrmarti is already working on this.
Since Feb 5, 2026.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 469
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
I'm using Dev Containers with the experimental git worktree support setting enabled. My setup is a git worktree that's a sibling to the main repository:
Issue: When my devcontainer.json includes a custom workspaceMount configuration, the experimental worktree feature does not mount the main repository's .git directory. The worktree's .git file references a relative path (e.g., gitdir: ../main-repo/.git/worktrees/my-worktree) that doesn't resolve inside the container.
Reproduction steps:
- Create a git worktree as a sibling to the main repository
- Have a devcontainer.json inside the worktree with a custom workspaceMount:
{
"workspaceMount": "source=${localWorkspaceFolder}/../../,target=/workspace,type=bind",
"workspaceFolder": "/workspace/services/my-service"
}
- Enable experimental worktree support
- Open the folder in a devcontainer
- Git source control doesn't work — the path in the worktree's .git file doesn't exist
Expected behavior: The experimental feature should detect the worktree and mount the main repository's .git directory even when workspaceMount is customized.
Workaround: Removing the custom workspaceMount configuration allows the experimental feature to work correctly. It appears the feature only auto-mounts the main .git when using the default mount behavior.
(@chrmarti )
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.