DEV Community

Aashutosh Poudel
Aashutosh Poudel

Posted on

Adding Git autocomplete to PowerShell (Windows)

In order to get bash like git autocomplete in Powershell, install the posh-git package.

  1. Fulfill the conditions mentioned in the prerequisite:
    https://github.com/dahlbyk/posh-git#prerequisites
    a. Make sure PowerShell version greater than 6 is installed.
    b. Make sure git is installed and in the PATH.
    c. Make sure the script execution policy is set to RemoteSigned or Unrestricted.

  2. In PowerShell execute:

PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force
Enter fullscreen mode Exit fullscreen mode
  1. Add posh-git to PowerShell profiles by either running Add-PoshGitToProfile -AllHosts or add it to the profiles file located at: C:\Program Files\PowerShell\7\Microsoft.PowerShell_profile.ps1 (Create the file if it doesn't exist).

References:

Top comments (1)

Collapse
 
eddorneles profile image
eddorneles

Thank you very much for the help!

It worked easily!