Rough guide on manually setting up Git on Windows

For both machines I'm doing this on (running Windows 7 and Windows 8) I had already installed Github for Windows. However, since I've been converted to posh-git, I wanted to do an install that would get me away from continuing to use it.

The below is roughly what I did, and may not be completely correct.

  1. Install the latest version of msysgit (currently 1.8.4).
  2. Set execution policy (run as administrator).
    • Set-ExecutionPolicy RemoteSigned
  3. Install posh-git
    • (new-object Net.WebClient).DownloadString("") | iex
  4. Possibly open the Powershell profile and add the Git path when Powershell runs.
    • notepad $profile
    • Add to the top of the file:
      $env:path += ";" + (Get-Item "Env:ProgramFiles(x86)").Value + "\Git\bin"
    • Reload profile:
      . $profile
    • Thanks to G. Lombard.
  5. Actually install posh-git.
    • install-module posh-git
    • Reload profile:
      . $profile
  6. Verify/set global config options (user name and email).
    • git config --global -l
    • git config --global "Your Name Here"
    • git config --global "[email protected]"
  7. Update push behavior:
  8. Since I'm using Powershell 3.0 (ISE), I decided to remove the 'Dark' color versions of the displayed information:
    • notepad $profile
    • Add the following at the end of the file:
      • $global:GitPromptSettings.BeforeIndexForegroundColor = [ConsoleColor]::Green
        $global:GitPromptSettings.IndexForegroundColor = [ConsoleColor]::Green
        $global:GitPromptSettings.WorkingForegroundColor = [ConsoleColor]::Red
        $global:GitPromptSettings.UntrackedForegroundColor = [ConsoleColor]::Red
      • See also Git customizing colors for Windows including posh-git
        • This involved running these two commands:
          git config --global color.status.changed "magenta normal bold"
          git config --global color.status.untracked "magenta normal bold"