question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Git: Support git worktrees in workspace

See original GitHub issue
$ mkdir repro
$ cd repro
$ mkdir example1
$ cd example1
$ git init; echo "hello" > world.txt; git add world.txt; git commit -m "init";
$ git worktree add ../example1branchA
$ git worktree add ../example1branchB
$ cd ..

$ mkdir example2
$ cd example2
$ git init; echo "hello" > world.txt; git add world.txt; git commit -m "init";
$ cd ..

Scenario:

  1. Open repro directory in VS Code
  2. Go to Git tab.

Expected: “Source Control Providers” lists Git repos.

  • example1
  • example1branchA
  • example1branchB
  • example2

Actual: “Source Control Providers” lists Git repos.

  • example1
  • example2

I sometimes will have lots of branches checked out in parallel on huge repos that I can’t afford to clone multiple times. I would also like to be able to use VS Code’s source control functionality with these checkouts all the same.

Thanks! and thanks for Code!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:51
  • Comments:17

github_iconTop GitHub Comments

14reactions
colemickenscommented, Feb 7, 2019

Thank you honorable vscodebot, but this feature request is not a duplicate of that issue.

11reactions
halfdancommented, Feb 15, 2022

What’s missing here is the ability to switch between branches and/or create a new worktree when working in a bare repo. The branch listing works just fine but vscode doesn’t automatically change the working directories when I select a branch that exists as a worktree.

Read more comments on GitHub >

github_iconTop Results From Across the Web

git-worktree Documentation - Git
A git repository can support multiple working trees, allowing you to check out more than one branch at a time. With git worktree...
Read more >
Experiment on your code freely with Git worktree
A Git worktree is a linked copy of your Git repository, allowing you to have multiple branches checked out at a time. A...
Read more >
Git Worktrees in Use - Medium
Let's learn how to use Git worktrees! Cloning Your Repo. Let's start by cloning the repository to your machine. $ git clone —...
Read more >
Use git worktree add and never switch branches again
Git Worktree Add Example I was today years old when I learned you could have multiple git working trees active at the same...
Read more >
Tech Tuesday - Git Worktrees - YouTube
Manage multiple working trees attached to the same repository.A git repository can support multiple working trees, allowing you to check out ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found