Skip to content
February 16, 2014 / windperson

Enable Git highlight hint in Windows PowerShell

  1. Install git for windows
    http://git-scm.com/download/win
  2. Set
    C:\Program Files (x86)\Git\cmd (64bit OS)
    or
    C:\Program Files\Git\cmd (32bit OS)
    to system path environment variable.
  3. Run PowerShell command line with Admin privilege, execute:
    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm
    

    select “Y” on asked questions.

  4. Clone posh-git
    https://github.com/dahlbyk/posh-git
    to local directory.
  5. Use the step.3 PowerShell window, switch to the directory cloned posh-git repository in step.4, run:
    .\install.ps1
    
  6. Close the PowerShell window, open another new PowerShell window with normal privilege, run:
    notepad $profile
    
  7. Add following line to top of the just opened profile content
    64bit OS

    $env:path += ";" + (Get-Item "Env:ProgramFiles(x86)").Value + "\Git\bin"
    

    32bit OS

    $env:path += ";" + (Get-Item "Env:ProgramFiles").Value + "\Git\bin"
    
  8. Save the profile file and reopen the PowerShell window, done.
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: