FredBainbridge

Git and the PowerShell prompt

There is lots of information out there on using Posh-Git. This is nothing new, its just a little helper for me since I have been recently been shuffling through workstations at an alarming rate. If it is useful for you as well, stellar!

  1. Install GIT

https://git-scm.com/download/win

  1. From an elevated powershell prompt:
Install-Package posh-git

Posh-Git-Install

  1. Modify your profile for PowerShell and PowerShell_ISE

Reference for PowerShell profiles

Posh-Git will install in C:\Program Files\WindowsPowerShell\Modules\posh-git\0.6.1.20160330. This will obviously change as newer versions are released. Verify the path with this command –

(Get-Module Posh-Git).Path

In this directory you will find profile.example.ps1

Comment out line 4 and uncomment line 8. (Unless this doesn’t work for you, then make the modifications that would work for you)

Posh-Git-ProfileCode

  1. Make any additional modification you want to make to your profile and then copy the contents of profile.example.ps1 to:

C:\Users[username]\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 and

C:\Users[username]\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1

Posh-Git-Profile

  1. Start a new PowerShell instance and then create a new GIT repository. Check out your awesome prompt.

Posh-Git-Prompt


Share