when inside a git repository, is it possible to add tab completion for git branches to Powershell? ie:
PS> git checkout ma<tab>
would result in
PS> git checkout master
when inside a git repository, is it possible to add tab completion for git branches to Powershell? ie:
PS> git checkout ma<tab>
would result in
PS> git checkout master
For that to be possible, a git provider for PowerShell would need to exist.
After a quick search, something similar apparently exists, the bizarre but aptly named posh-git:
http://github.com/dahlbyk/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. You can also choose whether advanced git commands are shown in the tab expansion or only simple/common commands. Default is simple.
Here are some blog posts that explain how to do something like this:
http://www.jeremyskinner.co.uk/2010/03/07/using-git-with-windows-powershell/
I wrote a generic provider for PowerShell whose behaviour can be implemented entirely in powershell script. This would be an ideal starting spot to prototype a GIT provider if one does not exist (or is dead, or insufficent.)
http://psprovider.codeplex.com
-Oisin