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

119,478

Downloads

38,021

Downloads of v 0.7.1

3/15/2017

Last update

posh-git

0.7.1

Package test results are passing.

This package was approved as a trusted package on 7/18/2017.

posh-git

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

Usage

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

Files

Hide
  • tools\chocolateyInstall.ps1 Show
    try {
        $poshgitPath = join-path (Get-ToolsLocation) 'poshgit'
    
        try {
          if (test-path($poshgitPath)) {
            Write-Host "Attempting to remove existing `'$poshgitPath`'."
            remove-item $poshgitPath -recurse -force
          }
        } catch {
          Write-Host "Could not remove `'$poshgitPath`'"
        }
    
        $version = "v$Env:chocolateyPackageVersion"
        if ($version -eq 'v') { $version = 'master' }
        $poshGitInstall = if ($env:poshGit ) { $env:poshGit } else { "https://github.com/dahlbyk/posh-git/zipball/$version" }
        $zip = Install-ChocolateyZipPackage 'poshgit' $poshGitInstall $poshgitPath
        $currentVersionPath = Get-ChildItem "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime | Select-Object -Last 1
    
        if(Test-Path $PROFILE) {
            $oldProfile = @(Get-Content $PROFILE)
    
            . $currentVersionPath\src\Utils.ps1
            $oldProfileEncoding = Get-FileEncoding $PROFILE
    
            $newProfile = @()
            foreach($line in $oldProfile) {
                if ($line -like '*PoshGitPrompt*') { continue; }
    
                if($line -like '. *posh-git*profile.example.ps1*') {
                    $line = ". '$currentVersionPath\profile.example.ps1' choco"
                }
                if($line -like 'Import-Module *\src\posh-git.psd1*') {
                    $line = "Import-Module '$currentVersionPath\src\posh-git.psd1'"
                }
                $newProfile += $line
            }
            Set-Content -path $profile -value $newProfile -Force -Encoding $oldProfileEncoding
        }
    
        $installer = Join-Path $currentVersionPath 'install.ps1'
        & $installer
    } catch {
      try {
        if($oldProfile){ Set-Content -path $PROFILE -value $oldProfile -Force -Encoding $oldProfileEncoding }
      }
      catch {}
      throw
    }
    
    
  • tools\chocolateyUninstall.ps1 Show
    try {
        $poshgitPath = join-path (Get-ToolsLocation) 'poshgit'
    
        $currentVersionPath = Get-ChildItem "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime | Select-Object -Last 1
    
        if(Test-Path $PROFILE) {
            $oldProfile = @(Get-Content $PROFILE)
    
            . $currentVersionPath\src\Utils.ps1
            $oldProfileEncoding = Get-FileEncoding $PROFILE
    
            $newProfile = @()
            foreach($line in $oldProfile) {
                if ($line -like '*PoshGitPrompt*') { continue; }
                if ($line -like '*Load posh-git example profile*') { continue; }
                if ($line -like '*Start-SshAgent*') { continue; }
    
                if($line -like '. *posh-git*profile.example.ps1*') {
                    continue;
                }
                if($line -like 'Import-Module *\src\posh-git.psd1*') {
                    continue;
                }
                $newProfile += $line
            }
            Set-Content -path $profile -value $newProfile -Force -Encoding $oldProfileEncoding
        }
    
        try {
          if (test-path($poshgitPath)) {
            Write-Host "Attempting to remove existing `'$poshgitPath`'."
            remove-item $poshgitPath -recurse -force
          }
        } catch {
          Write-Host "Could not remove `'$poshgitPath`'"
        }
    } catch {
      try {
        if($oldProfile){ Set-Content -path $PROFILE -value $oldProfile -Force -Encoding $oldProfileEncoding }
      }
      catch {}
      throw
    }
    
    

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.

Dependencies

Maintainer(s)

Software Author(s)

  • Keith Dahlby
  • Mark Embling
  • Jeremy Skinner
  • Keith Hill

Tags

Version History

Version Downloads Last updated Status
posh-git 0.7.1-pre1 60 Sunday, March 12, 2017 approved
posh-git 0.7.0 7023 Tuesday, February 14, 2017 approved
posh-git 0.7.0-pre5 118 Friday, February 3, 2017 approved
posh-git 0.7.0-pre4 150 Tuesday, January 31, 2017 approved
posh-git 0.7.0-pre3 33 Monday, January 30, 2017 approved
posh-git 0.7.0-pre2 37 Monday, January 30, 2017 exempted
posh-git 0.7.0-pre1 61 Monday, January 30, 2017 exempted
posh-git 0.6.1.20160330 30708 Wednesday, March 30, 2016 approved
posh-git 0.6.0.20160310 1453 Thursday, March 10, 2016 approved
Show More

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