Visual Studio 2019: New Windows Terminal has arrived, how to enhance it with posh-git for GIT usage?
The new Windows Terminal has arrived on Visual Studio 2019 16.6 for Windows and Visual Studio 8.6 for Mac. In this article I will show how to enhance it with posh-git for a better experience with GIT commands.
posh-git is a PowerShell environment for Git that provides powerful tab-completion facilities, as well as an enhanced prompt to help you stay on top of your repository status. Because The new terminal is compatible with PowerShell (and also classical command prompt) we are able to use them together for a better experience with GIT. Here is a tutorial to install it:
First, set the value of
RemoteSigned for all users use the next command:
Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy RemoteSigned -Force
Then install it from the PowerShell gallery:
Install-Module posh-git -Scope CurrentUser -Force
At least update your PowerShell prompt with the following command:
You can find here more documentation about it: https://github.com/dahlbyk/posh-git
Now you can open a new Windows Terminal from the menu here:
Then you can open as many windows as you want, remember, if you want to use posh-git, open a Developer PowerShell window:
As you can see your Git experience is really better, you won’t need to check your staged files on the Visual Studio Team explorer panel 🙂