Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I have two instances of Visual Studio working on different GIT repos on the same machine?

I work as a developer in an Agile software development team. We have a single origin repo containing the master branch and a number of 'live' feature branches. Our working practice is to create a feature branch for each story from master, finish the work, run it by QA and the POs before raising a PR after which it's merged into the master branch and the feature branch is destroyed in origin.

Sometimes I'm working on a story and it's temporarily blocked for some reason. Normally I would commit or stash my changes, then checkout a different branch, rebuild etc. and start working on that. However, it would be much more convenient if I could have two (or more) instances of Visual Studio working on different branches, so that I could swap between them without committing/stashing etc.

Is this possible?

like image 646
Edwardo Avatar asked Sep 03 '25 09:09

Edwardo


2 Answers

There are options.

  1. Clone the repo twice to a different location in disk and open each location in a different VS instance.
  2. Use Git worktree to add a 2nd working folder to your existing clone
like image 51
jessehouwing Avatar answered Sep 05 '25 00:09

jessehouwing


If you have a single instance of repo, then it is not possible to be in two different branches at the same time(which I think you are already aware of).

I would suggest you to create two instances of the same repo and open them in two instances of VS code and then you can open the two branches needed at the same time.

like image 31
Subham Jain Avatar answered Sep 05 '25 01:09

Subham Jain