Display current Git branch in Visual Studio?

11,067

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.

Enter image description here

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 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

Share:
11,067
Mes
Author by

Mes

Swedish growth hacker.

Updated on August 02, 2022

Comments

  • Mes
    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?