posh-git Release v0.3

On a whim, I’ve decided to tag a v0.3 release of posh-git (which has been stable for a few months now). In this release…


Previously the setup process for posh-git was undefined. Daniel Hoelbling was kind enough to put together a getting-started post, but I decided to make it even easier. Assuming Git and PowerShell are configured correctly (see readme for details), getting started is trivial:

cd C:\Wherever
git clone https://github.com/dahlbyk/posh-git.git

At this point the sample posh-git profile will be loaded as part of your PowerShell profile. If you don’t like the sample profile, feel free to grab the pieces you want and discard the rest (so you can use posh-hg too, perhaps).

Update: If you already have posh-git installed, just cd into your posh-git directory and pull from my master branch:

# If you don't already have me as a remote...
git remote add dahlbyk
git pull --rebase dahlbyk master

You don’t need to run install.ps1 again; just open a new PowerShell session and you’re good to go.


By taking a dependency on msysgit 1.7.1, all status information is now retrieved in a single call (git status -s -b). This still means git status is called for every prompt, so if status is slow for your repository your prompt will be slow too.

If it’s still too slow for your taste, you also have the option to set $GitPromptSettings.EnableFileStatus = $false. This will preserve branch information for the prompt, but skip everything else (counts and tab completion for added/modified/deleted files).

Finally, you can set $GitPromptSettings.Debug = $true to see how long the various steps take behind the scenes. If your environment is anything like mine, the majority of the time will be spent in git calls.

Tab Expansion Updates

  • Fix for git rm during deleted/updated merge conflict
  • Branch expansion for cherry-pick, diff, difftool, log and show
  • Normal expansion through simple aliases (e.g. alias.dt = difftool supports git dt <tab>)

Next Steps

  • I’d still like to get some testing in place so I don’t break things unintentionally
  • I’m considering moving away from regex to parse commands for tab expansion — anyone feel like writing a git command parser in PowerShell?
  • I’d like it to be easier to use posh-git and posh-hg together, so I may revisit how they hook into tab expansion

As always, your feedback is appreciated. If you’d like posh-git updates between release posts, you can also follow me on Twitter.

Posted in Git. Tags: . Comments Off on posh-git Release v0.3

posh-git Release v0.2

I just tagged the v0.2 release of posh-git, which you can download here. This is the last release supporing msysgit 1.6.5 and 1.7.0. In this release…

PowerShell Module

Thanks to a contribution from David Muhundro, posh-git now exposes its functions through a module (.psm1). The module exposes a number of functions whose usage can be seen in the example profile.

Tab Expansion Updates

  • TortoiseGit commands: tgit <tab>
  • git-svn operations: git svn <tab>
  • Stash completion for git stash operations: show, apply, drop, pop, branch
  • Branch completion for git reset and git rebase
  • Completion of deleted files for git rm
  • For most commands, tab completion should now work if other command flags are in use. For example, git rebase -i <tab> works as expected.

Thanks to Jeremy Skinner and Mark Embling for their contributions to this release.

Next Steps

The most common complaint about posh-git is performance, which has already been addressed for the next release (available in my master branch). However, the fix requires taking a dependency on msysgit 1.7.1, which has not been officially released yet.  Still, it has been working fine for me.

Beyond that, we still need to address the first two items on my list from the last release…

  • Testing! I’d like to figure out a way to run some integration tests that verify a given repository state renders the expected prompt. If you have suggestions how to approach this, or know how other Git integration projects are tested, please let us know over at the Google Group.
  • Documentation! How to get started, what the project provides, etc.

If you have any other feature requests or find issues, please let us know.

Posted in PowerShell. Tags: , . Comments Off on posh-git Release v0.2