Skip to content

Latest commit

History

603 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Git Worktree Manager

Visual Studio Marketplace InstallsOpen VSX DownloadsGitHub releaseGitHub Open IssuesLicenseGitHub Stars

English | ็ฎ€ไฝ“ไธญๆ–‡

Manage Git worktrees safely and efficiently inside Visual Studio Code.
Create, switch, and clean up worktrees without losing track of your branches.

Support ๐Ÿ’–

If you enjoy this extension, consider giving it a star โญ and sharing it on social platforms like X.comโ€”it really helps!

PayPal Donate
PayPal
WeChat Donate
ๅพฎไฟก

Why Git Worktree Manager? ๐ŸŒŸ

Git worktrees make parallel development cleaner by isolating branches into separate directories,
but managing them manually can be tedious and error-prone.

Git Worktree Manager brings worktree management into VS Code,
helping you create, switch, and clean up worktrees safely while keeping your repository organized.

Manage multiple repositories effortlessly within VSCode.

Key Features ๐ŸŽฏ

Getting Started ๐Ÿš€

  1. Requirements

    • git version >= 2.40
  2. Install the Extension:

  3. Quick Start:

    • Open VSCode in a Git repository.
    • Press Ctrl+Shift+R to launch the worktree manager.
    • Create, switch, or delete worktrees using the intuitive interface.
  4. Example Workflow:

    • Create a new worktree: Select โ€œCreate Worktreeโ€ and specify a branch.
    • Switch to it instantly via the Source Control view or command palette.
    • Add it to your VSCode workspace to work on multiple branches side by side.
    • Save it to favorites for quick access in the future.

Configuration โš™๏ธ

Customize Git Worktree Manager to fit your workflow:

  • git-worktree-manager.treeView.toSCM
    Display worktrees in the Source Control view.

  • git-worktree-manager.treeView.worktreeDescriptionTemplate
    Customize the description next to each worktree in the tree view. Handy for spotting stale worktrees at a glance.
    Available variables: $FULL_PATH, $BASE_NAME, $RELATIVE_PATH, $LAST_COMMIT (relative time of the last commit, e.g. "3 weeks ago"). Hover a worktree to see the absolute timestamp.
    Example:"$RELATIVE_PATH ยท $LAST_COMMIT"

  • git-worktree-manager.treeView.worktreeLabelTemplate
    Customize the label (the bold text) of each worktree in the tree view. Leave empty to keep the default label (the branch or tag name).
    Available variables: $REF_NAME (branch or tag name), $BASE_NAME, $FULL_PATH, $RELATIVE_PATH, $LAST_COMMIT.
    Example:"$BASE_NAME โ‡„ $REF_NAME" shows the worktree folder name first, then the branch.

  • git-worktree-manager.worktreeCopyPatterns
    Specify files or directories to be copied into a newly created worktree
    (for example, local config files or environment-specific assets).
    Example:[".env.local", "config/*.json"]

  • git-worktree-manager.worktreeCopyIgnores
    Exclude specific files or paths from being copied when creating a worktree,
    even if they match worktreeCopyPatterns.
    Example:["node_modules/**", "dist/**"]

  • git-worktree-manager.postCreateCmd
    Run a command automatically after a worktree is created
    (for example, installing dependencies or running setup scripts).
    Example:"pnpm install" or "echo 'Worktree ready'"

  • git-worktree-manager.preRemoveCmd
    Run a command automatically before a worktree is removed
    (for example, tearing down side effects such as a per-worktree database
    schema or stopping services).
    Runs inside the worktree directory. If the command fails or is cancelled,
    the removal is aborted.
    Example:"pnpm run worktree:teardown-db"

  • terminal.external.windowsExec
    Set the external terminal on Windows
    (e.g. "C:\\Program Files\\Git\\bin\\bash.exe" for Git Bash).

  • terminal.external.osxExec
    Set the external terminal on macOS
    (e.g. "iTerm.app").

Contributing ๐Ÿค

We love contributions! Hereโ€™s how to get involved:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/awesome-idea).
  3. Commit your changes (git commit -m "Add awesome idea").
  4. Push to the branch (git push origin feature/awesome-idea).
  5. Open a Pull Request.

Have ideas? Open an issue with the "enhancement" tag or explore open issues.

License ๐Ÿ“œ

Distributed under the MIT License. Use, modify, and share freely!

About

Effortlessly manage Git worktrees in Visual Studio Code! ๐Ÿš€

Topics

Resources

Stars

281 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages