Let's say we have a solution with 2 Projects and these projects are hosted in
two different Git repos (it can be any Git provider like GitHub, Azure DevOps,
BitBucket etc). You are working on both the projects at the same time and committing changes.
In this kind of a scenario, if you are using an earlier version of Visual
Studio, for example, Visual Studio 2019, handling/committing changes can be a
real pain. If you have the solution opened, Visual Studio will be tracking
only one repo at a time, so you need to be extra careful when committing
changes to select the appropriate target repo using the
Repo Selector in the bottom toolbar of Visual Studio.
Or you will have to use different Visual Studio instances, or use another
git tooling to commit the changes.
But as the Visual Studio team is trying to make the git experience within
Visual Studio more user-friendly,
Visual Studio 2022 Preview 3
has introduced this new feature which is Multi-repo support. As of today
it's still in its Preview and is disabled by default. If you want try out this feature, you need to explicitly enable it by navigating into Tools ->
Options -> Environment -> Preview Features and turning on
Enable multi-repo support.
Visual Studio 2022 - Enable multi-repo support |
Once you have enabled multi-repo support and opened up a solution with multi repo projects, you will see Visual Studio is automatically identifing different repos in the solution. It will bold out the active repos within the list of
all the repositories.
Visual Studio 2022 - Enable multi-repo support |
Visual Studio 2022 - Git changes and committing to multiple repos |
Visual Studio 2022 - Git Changes and committing to a single repo |
Manage Branches with multi-repo |
Hope this helps.
Happy Coding.
Regards,
Jaliya
No comments:
Post a Comment