{"id":233737,"date":"2021-08-11T08:00:32","date_gmt":"2021-08-11T15:00:32","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=233737"},"modified":"2021-08-11T09:31:03","modified_gmt":"2021-08-11T16:31:03","slug":"multi-repo-support-in-visual-studio","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/multi-repo-support-in-visual-studio\/","title":{"rendered":"Multi-repo Support in Visual Studio"},"content":{"rendered":"<p style=\"text-align: center;\"><video controls=\"controls\" width=\"700\" height=\"400\"><source src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/Git-Part3-MultiRepo_Support.mp4\" type=\"video\/mp4\" \/><\/video><\/p>\n<p>Have you ever needed to work on a solution with projects hosted on different Git repositories? Previously, you had to either use multiple instances of Visual Studio or rely on external Git tools. Starting with Visual Studio 2022 Preview 3, you can enable the multi-repo support preview feature which will enable you to work with a single solution with projects in multiple repositories and contribute to them from a single instance of Visual Studio.<\/p>\n<p style=\"text-align: center;\"><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/aka.ms\/vs2022preview\" target=\"_blank\">Download Visual Studio 2022 Preview<\/a><\/div><\/p>\n<p>The easiest way to enable multi-repo support is to use CTRL+Q, type \u201cpreview\u201d and open the preview features pane. Scroll to \u201cEnable multi-repo support\u201d and toggle the checkbox. This functionality is still a preview feature, which means we are working hard to add more support in the coming releases. In the meantime, we\u2019re depending on your feedback, the community, to build what you need.<\/p>\n<p><figure id=\"attachment_233752\" aria-labelledby=\"figcaption_attachment_233752\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/PreviewFlag.png\"><img decoding=\"async\" class=\"wp-image-233752 size-full\" title=\"Preview features pane in Visual Studio 2022 Preview3\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/PreviewFlag.png\" alt=\"Image PreviewFlag\" width=\"1248\" height=\"175\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/PreviewFlag.png 1248w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/PreviewFlag-300x42.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/PreviewFlag-1024x144.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/PreviewFlag-768x108.png 768w\" sizes=\"(max-width: 1248px) 100vw, 1248px\" \/><\/a><figcaption id=\"figcaption_attachment_233752\" class=\"wp-caption-text\">Preview features pane in Visual Studio 2022 Preview<\/figcaption><\/figure><\/p>\n<p>&nbsp;<\/p>\n<h3>Open solution with projects in different repositories<\/h3>\n<p>If you already have a solution with projects hosted on different Git repositories, just open your solution using Visual Studio\u2019s Start Window or using <strong><em>File &gt; Open &gt; Project\/Solution<\/em><\/strong> and Visual Studio will automatically activate up to 10 repositories at the same time. You will be able to tell if Visual Studio has activated your different Git repositories by looking at the repository picker on the status bar (located at the lower right corner), which will tell you the number of active repositories you have. Active repositories show bolded on the repository picker.<\/p>\n<p><figure id=\"attachment_233756\" aria-labelledby=\"figcaption_attachment_233756\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-StatusBar.png\"><img decoding=\"async\" class=\"wp-image-233756\" title=\"the repository picker on the status bar\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-StatusBar-300x236.png\" alt=\"Repository picker on the status bar\" width=\"330\" height=\"260\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-StatusBar-300x236.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-StatusBar-1024x804.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-StatusBar-768x603.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-StatusBar.png 1411w\" sizes=\"(max-width: 330px) 100vw, 330px\" \/><\/a><figcaption id=\"figcaption_attachment_233756\" class=\"wp-caption-text\">Repository picker on the status bar<\/figcaption><\/figure><\/p>\n<p>You can also add projects hosted on different repositories to your existing solution by right clicking on your solution in Solution Explorer and selecting <strong><em>Add &gt; Existing Project<\/em><\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<h3>Committing Changes<\/h3>\n<p>The Git Changes Window will automatically track changes cross repositories. All you need to do is write a commit message and click the &#8220;Commit All Repos&#8221; button for all of your changes to be committed. You can also choose to stage your changes first which enables you to choose the repositories you would like to commit to. Alternatively, you can use the repository picker at the top of the Git Changes window to focus on and commit changes to one repository at a time.<\/p>\n<p><figure id=\"attachment_233783\" aria-labelledby=\"figcaption_attachment_233783\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChanges-1.png\"><img decoding=\"async\" class=\"wp-image-233783\" title=\"Committing changes to single and multiple repositories\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChanges-1-1024x590.png\" alt=\"Committing changes to multiple repositories\" width=\"603\" height=\"347\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChanges-1-1024x590.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChanges-1-300x173.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChanges-1-768x443.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChanges-1-1536x885.png 1536w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChanges-1-2048x1180.png 2048w\" sizes=\"(max-width: 603px) 100vw, 603px\" \/><\/a><figcaption id=\"figcaption_attachment_233783\" class=\"wp-caption-text\">Committing changes to multiple repositories<\/figcaption><\/figure><\/p>\n<p>&nbsp;<\/p>\n<h3>Amend, Stash, Branch switching &amp; Network operations<\/h3>\n<p>Multi-repo support for Amend, Stash, Branch switching and network operations including Pull, Push, Fetch and Sync is coming to the Git Changes window in future iterations. To use any of these operations now, you will have to use the repository picker to focus on one repository at a time. Alternatively, for branching you can rely on the Git Repository Window as demonstrated in the following section.<\/p>\n<p><figure id=\"attachment_233763\" aria-labelledby=\"figcaption_attachment_233763\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChangesBranches.png\"><img decoding=\"async\" class=\"wp-image-233763\" title=\"Using the repository picker to focus on a single repository\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChangesBranches-1024x503.png\" alt=\"Using the repository picker to focus on a single repository\" width=\"541\" height=\"266\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChangesBranches-1024x503.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChangesBranches-300x147.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChangesBranches-768x378.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChangesBranches-1536x755.png 1536w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitChangesBranches.png 1611w\" sizes=\"(max-width: 541px) 100vw, 541px\" \/><\/a><figcaption id=\"figcaption_attachment_233763\" class=\"wp-caption-text\">Using the repository picker to focus on a single repository<\/figcaption><\/figure><\/p>\n<p>&nbsp;<\/p>\n<h3>Branch &amp; Repository Management<\/h3>\n<p>The Git Repository window recognizes all active repositories and provides cross repository browsing and management experience. You can preview, create, manage, and switch branches right from this window. Commit details, embedded diff and incoming\/outgoing commits all function as they do with single repositories.<\/p>\n<p><figure id=\"attachment_233765\" aria-labelledby=\"figcaption_attachment_233765\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitRepo.png\"><img decoding=\"async\" class=\"wp-image-233765 size-full\" title=\"Git Repository Window Multi-repo Support\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitRepo.png\" alt=\"Git Repository Window Multi-repo Support\" width=\"1248\" height=\"354\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitRepo.png 1248w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitRepo-300x85.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitRepo-1024x290.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/08\/MultiRepo-GitRepo-768x218.png 768w\" sizes=\"(max-width: 1248px) 100vw, 1248px\" \/><\/a><figcaption id=\"figcaption_attachment_233765\" class=\"wp-caption-text\">Git Repository Window Multi-repo Support<\/figcaption><\/figure><\/p>\n<p>&nbsp;<\/p>\n<h3>Let us know what you think<\/h3>\n<p>We have benefitted greatly from all the rich feedback we\u2019ve received from you \u2013 thank you! We hope you\u2019ll help us continue to improve by giving the new multi-repo preview feature a try and letting us know what you think by taking the following quick survey:<\/p>\n<p style=\"text-align: center;\"><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/aka.ms\/MultiRepoSurveyBlog\" target=\"_blank\">Share Your Feedback<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever needed to work on a solution with projects hosted on different Git repositories? Previously, you had to either use multiple instances of Visual Studio or rely on external Git tools. Starting with Visual Studio 2022 Preview 3, you can enable the multi-repo support preview feature which will enable you to work with [&hellip;]<\/p>\n","protected":false},"author":4322,"featured_media":233891,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[155],"tags":[6758,6822,6823,6824,12],"class_list":["post-233737","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-git-integration","tag-multi-repo","tag-multiple-repositories","tag-submodules","tag-visual-studio"],"acf":[],"blog_post_summary":"<p>Have you ever needed to work on a solution with projects hosted on different Git repositories? Previously, you had to either use multiple instances of Visual Studio or rely on external Git tools. Starting with Visual Studio 2022 Preview 3, you can enable the multi-repo support preview feature which will enable you to work with [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/233737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/4322"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=233737"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/233737\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/233891"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=233737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=233737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=233737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}