Show git branch in Visual Studio Code

Assuming you have git installed all you do is go to View->Show Status Bar (as seen below). It will then show your current branch on the bottom of your current editor window.

Menu Being Selected


For windows: The easiest thing would be to change your integrated terminal shell from Powershell to Git Bash. You can do that by going to File > Preferences > Setting and changing the integrated terminal shell, as illustrated below:

enter image description here

For mac navigate to: Code> Preferences> settings> Search for 'terminal'


In the docs it says:

Note: VS Code will leverage your machine's Git installation, so you need to install Git first before you get these features. Make sure you install at least version 2.0.0.

So there needs to be a Git on your system to get it working. Using the embedded Git from your Sourcetree installation will probably work, but might not be the cleanest solution. The Git in my Sourcetree installation (on a Mac) is about 3 years old (2.2.1). On a Mac there is also a Git preinstalled though (2.11.0), so here it works out of the box.