How to show current git branch in Visual Studio Code (VS Code)’s Terminal from Microsoft Windows

Bryant Jimin Son
2 min readJul 20, 2023

If you are using Microsoft Windows and interact with git, it might be convenient for you to use Visual Studio Code’s built-in Terminal window to interact with git instead of switch back and forth between Git CLI and VS Code. Unfortunately, your default Terminal might look like this in your VS Code’s Terminal when you go to a git initialized or cloned directory.

Does not show current branch

What can you do to show the current branch? First, click File option in top tool bar then go to Preferences then Settings.

Go to File > Preferences > Settings

And open a File Explorer window. Try to locate Git Bash’s installation path. For me, it is under C:\Program Files\Git. You will need to copy the path and the file name git-bash.exe

Copy the path to the file

Now, let’s go back to your VS Code’s Settings again. From there, we need to make two changes. First, let’s search for terminal. Then, under Terminal: External Window Exec, replace the path value with the path to git-bash.exe.

Replace value unde Terminal: External Window Exec with the path to git-bash.exe

We also need to make one more change. Search for Integrated Shell: Windows this time. Select the drop down under Terminal: Integrated > Default Profile: Windows and select Git Bash.

Select the drop down under Terminal: Integrated > Default Profile: Windows and select Git Bash.

Your final selection should be like this.

Git Bash is selected as the default

Now, close your Terminal window and open new one again. cd inside a git clone directory and it should now show your current branch.

Your current branch now should be displayed.

--

--

Bryant Jimin Son

A cloud practitioner talking about technology, travels & career tips. But I will sometimes cover financial advises and some random stuffs.