Skip to content

Configure default directory/pattern for git worktrees #293884

Open

Description

@sandstrom

When using Git worktrees, it's quite common to not want them inside the .git directory for several reasons. However, Git doesn't offer any configurability.

It would be nice if VS Code (especially with the new Agents Window) would offer a setting for the directory/pattern of work directories.

Common structure

~/projects/org-1/my-repo/ main repo
~/projects/org-1/other-repo/ main repo

~/worktrees/org-1/my-repo/feat1/ worktree for branch feat1
~/worktrees/org-1/my-repo/feat2/ worktree for branch feat2

Example from Github Copilot app

Image

Example from Worktrunk CLI

Here is an example of how the popular worktrunk CLI does it (this level of configurability would be great):

# Centralized worktrees directory
# Creates: ~/worktrees/myproject/feature-auth
worktree-path = "~/worktrees/org-1/{{ repo }}/{{ branch | sanitize }}"

https://worktrunk.dev/config/#worktree-path-template

Activity

  1. changed the title [-]Configure default directory for git worktrees[/-] [+]Configure default directory/pattern for git worktrees[/+] on Feb 9, 2026
  2. sandstrom commented on Aug 27, 2026

    @sandstrom
    Author

    Short update. Github Copilot app now has this configurable in settings. Added a photo example above.

    Would be neat if VS Code also made it customizable in the same way, with variables.

  3. lszomoru commented on Nov 24, 2026

    @lszomoru
    Member

    Thanks for the suggestion. I checked the current Insiders (1.148.0, Linux): there's no setting for the worktree location or a path pattern. Searching Settings for "worktree" shows only settings for worktree detection, files to copy into new worktrees, and folders to symlink.

    What exists today:

    I'm keeping this open as a feature request for a configurable worktree base folder or path template.

    293884-worktree-settings.png

    🤖 Authored with GitHub Copilot on behalf of Ladislau Szomoru (@lszomoru).

  4. added
    feature-request
    git
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestgit

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions