How to use multiple Git repositories in Visual Studio 2017

Neal picture Neal · May 2, 2017 · Viewed 11.4k times · Source

My solution involves three Git repositories in a self-hosted Bitbucket Server. One repository for the iOS project, one repository for the shared project type such as libraries shared among other projects like Android, and then the company shared repository with more class libraries not project specific.

In Visual Studio 2015 I could go to the Team Explorer and connect to the various repositories, so I could view the commit history and have source control access to commit or pull from Git. In Visual Studio 2017 when I connect to one of the other repositories I am taken out of my solution back to the start page.

How can I manage multiple repositories that make up one Visual Studio 2017 solution? My only option right now is using an external tool such as Sourcetree.

Answer

Chad B picture Chad B · May 2, 2017

The design for Team Explorer has always been to close the solution if the containing Git repository was closed and a different repository was opened. If you were seeing different behavior in Visual Studio 2015, it was unintentional.

We would like to support multiple Git repositories open at the same time in Team Explorer, but that feature has not yet been added.

The Team Explorer extension provides the Git integration for Visual Studio. Regardless of whether you use VSTS or not, you'll still use Team Explorer for Git operations in the IDE. I completely agree that it would be great to support multiple repositories for a single solution. Features are prioritized and this one simply hasn't been built yet.