Display current Git branch in Visual Studio?
Solution 1
The Git Source Control Provider displays the branch name in the Pending Changes tool window.
The VSCommands extension adds the branch name to the Visual Studio 2013 title.
Solution 2
ShowMyGitBranch is a lightweight and straightforward solution for this. No configuration is required.
By the time I developed this extension I did not know VSCommands had a solution for this, so I did it with this very simple goal in mind.
Solution 3
Install the Rename Visual Studio Window extension.
Go to Tools → Options → Rename VS Window Title → Global rules, under Patterns → Solution
in xxx mode, and add [gitBranchName]
to the path.
Example: [parentPath]\[gitBranchName]
Update: They've changed the title of the extension to Customize Visual Studio Window Title
Comments
-
Mes almost 2 years
It's quite annoying to work in the wrong branch when using Git (in TFS). Is there a way to configure Visual Studio to clearly display what branch that's currently active? Like, put it in the title bar?
Below is outdated. The newer version of the extension in the link can display the Git branch now. No need to hack anymore.
If nothing exists maybe it could be possible to hack Labs → Visual Studio Extension: Customize Visual Studio Window Title (source code is at https://github.com/mayerwin/vs-customize-window-title). What is the code to get the current Git branch of the current project in Visual Studio?