
You can utilize them to quickly switch between branches and do lightweight branch management across all of your active repositories. The branch pickers on both the status bar and the Git Changes tool window now support multi-repo in Visual Studio. Once you enable the multi-repo feature flag and open a solution File > Open > Project/Solution with projects hosted on different Git repositories, Visual Studio will automatically activate up to 10 repositories at the same time. Note: Open a solution with projects hosted on different Git repositories to get started When you are done exploring and want to go back to your branch, you can choose to discard your changes by checking out an existing branch or choose to keep your changes by creating a new branch first.

Now that you are in a detached head state, feel free to run and test your code or even explore and commit changes. Once you confirm your action by clicking Yes, Visual Studio shows a confirmation message and both the Git Repository, and the Git Changes windows show a Detached at a Commit state.

Meaning that the HEAD of your repository is going to point directly to a commit instead of a branch. Visual Studio shows a confirmation dialog explaining that by checking out a commit you will be in a detached HEAD state. To checkout a previous commit in Visual Studio, open the Git Repository window View > Git Repository, right click on the commit you would like to go back to and select checkout (–detach). In this case, you can just checkout the tip of the remote branch that you would like to review. That way you don’t need to create a local branch if you are not planning on contributing to it. It can also be helpful if you would like to review code from a remote branch (a colleague’s branch, for example). For example, it allows you to go back to a previous point in your repository’s history where you can run or test your code. If you prefer an inline diff, you can use the diff configuration options gear and switch to an inline diff view.Ĭhecking out a commit can be beneficial in multiple ways.
