Windows PowerShell doesn’t come with any git command utilities. But we can extend it to a new level where we can utilize git commands efficiently. In this post, we are going to see how to add auto command suggestions on TAB, branch information, and a working directory in Windows PowerShell.
The following will be the outcome after following this guide.
NEED POWERSHELL GALLERY
To get that look at our default PowerShell, we will install two packages from PowerShell Gallery. To check what that Gallery is about click here. We will install posh-git and oh-my-posh packages as modules. The posh-git will provide prompt with Git status summary information and TAB completion for Git commands, parameters, remotes, and branch names. On the other hand, oh-my-posh will enable us to theme our terminal as our own.
By default, windows don’t have any package provider for PowerShell modules. If we run the following command, the package provider will automatically get installed. So let’s open the PowerShell and run those commands one after another. It will ask for our confirmation to install the packages. Type Y for affirmation and type A to make all upcoming prompt affirmative.
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
FIND A FONT WITH LIGATURES
Next, we need a typographic ligature supported font for our terminal. We will set that font from VSCode settings. Why do we need that? We need that to show the current branch, current changes status, etc. related symbols in the terminal. In this case, the Fira Code will be our best option. March ahead and download Fira Code from here. We need the TTF types so open the TTF folder and install all the fonts.
Find the rest of the article on my blog!
Top comments (1)
Thanks for the packages :)