Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display current Git branch in Visual Studio?

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?

like image 332
Niels Bosma Avatar asked Jan 15 '14 13:01

Niels Bosma


1 Answers

Install the Rename Visual Studio Window extension.

Go to ToolsOptionsRename VS Window TitleGlobal rules, under PatternsSolution 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

like image 125
Wei Avatar answered Nov 09 '22 08:11

Wei