Notices: This section not yet converted to new layout. Download stats are rolling back out.




Downloads of v


Last update


Package test results are passing.

Private CDN cached downloads available for licensed customers. Never experience 404 breakages again! Learn more...

This package was approved as a trusted package on 6/24/2016.


A set of PowerShell scripts which provide Git/PowerShell integration

Prompt for Git repositories

The prompt within Git repositories can show the current branch and the state of files (additions, modifications, deletions) within.

Tab completion

Provides tab completion for common commands when using git.
E.g. git ch<tab> --> git checkout


See profile.example.ps1 as to how you can integrate the tab completion and/or git prompt into your own profile. Prompt formatting, among other things, can be customized using $GitPromptSettings, $GitTabSettings and $TortoiseGitSettings.

Note on performance: displaying file status in the git prompt for a very large repo can be prohibitively slow. Rather than turn off file status entirely, you can disable it on a repo-by-repo basis by adding individual repository paths to $GitPromptSettings.RepositoriesInWhichToDisableFileStatus.

To install posh-git, run the following command from the command line or from PowerShell:

C:\> choco install poshgit

To upgrade posh-git, run the following command from the command line or from PowerShell:

C:\> choco upgrade poshgit


  • tools\chocolateyInstall.ps1 Show
    function Insert-Script([ref]$originalScript, $script) {
        if(!($originalScript.Value -Contains $script)) { $originalScript.Value += $script }
    try {
        $binRoot = Get-BinRoot
        $oldPromptOverride = "if(Test-Path Function:\Prompt) {Rename-Item Function:\Prompt PrePoshGitPrompt -Force}"
        $newPromptOverride = "function Prompt() {if(Test-Path Function:\PrePoshGitPrompt){++`$global:poshScope; New-Item function:\script:Write-host -value `"param([object] ```$object, ```$backgroundColor, ```$foregroundColor, [switch] ```$nonewline) `" -Force | Out-Null;`$private:p = PrePoshGitPrompt; if(--`$global:poshScope -eq 0) {Remove-Item function:\Write-Host -Force}}PoshGitPrompt}"
        $poshgitPath = join-path $binRoot 'poshgit'
        try {
          if (test-path($poshgitPath)) {
            Write-Host "Attempting to remove existing `'$poshgitPath`' prior to install."
            remove-item $poshgitPath -recurse -force
        } catch {
          Write-Host 'Could not remove poshgit folder'
        $poshGitInstall = if($env:poshGit -ne $null){ $env:poshGit } else {''}
        Install-ChocolateyZipPackage 'poshgit' $poshGitInstall $poshgitPath
        $pgitDir = Dir "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime | Select -Last 1
        if(Test-Path $PROFILE) {
            $oldProfile = @(Get-Content $PROFILE)
            $newProfile = @()
            #If old profile exists replace with new one and make sure prompt preservation function is on top
            $pgitExample = "$pgitDir\profile.example.ps1"
            foreach($line in $oldProfile) {
                if($line.ToLower().Contains("$poshgitPath".ToLower())) {
                    Insert-Script ([REF]$newProfile) $oldPromptOverride
                    $line = ". '$pgitExample'"
                if($line.Trim().Length -gt 0) {  $newProfile += $line }
            # Save any previous Prompt logic
            Insert-Script ([REF]$newProfile) $oldPromptOverride
            Set-Content -path $profile -value $newProfile -Force
        $subfolder = get-childitem $poshgitPath -recurse -include 'dahlbyk-posh-git-*' | select -First 1
        write-debug "Found and using folder `'$subfolder`'"
        $installer = Join-Path $subfolder 'install.ps1'
        & $installer
        $newProfile = @(Get-Content $PROFILE)
        Insert-Script ([REF]$newProfile) "Rename-Item Function:\Prompt PoshGitPrompt -Force"
        # function that will run previous prompt logic and then the poshgit logic
        # all output from previous prompts will be swallowed
        Insert-Script ([REF]$newProfile) $newPromptOverride
        Set-Content -path $profile  -value $newProfile -Force
    } catch {
      try {
        if($oldProfile){ Set-Content -path $PROFILE -value $oldProfile -Force }
      catch {}

Virus Scan Results

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.



Software Author(s)

  • Keith Dahlby
  • Mark Embling
  • Jeremy Skinner


Version History

Version Downloads Last updated Status
posh-git 1375 Thursday, March 10, 2016 approved
posh-git 9931 Tuesday, August 25, 2015 approved
posh-git 5869 Saturday, May 23, 2015 approved
posh-git 11568 Thursday, October 9, 2014 approved
posh-git 12433 Tuesday, July 17, 2012 approved
posh-git 0.4.0 392 Monday, May 14, 2012 approved
posh-git 425 Friday, February 3, 2012 approved
posh-git 397 Tuesday, August 23, 2011 approved
posh-git 0.3 256 Tuesday, August 23, 2011 approved

Discussion for the posh-git Package

Ground rules:

  • This discussion is only about posh-git and the posh-git package. If you have feedback for Chocolatey, please contact the google group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or posh-git, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.

comments powered by Disqus