Hybrid Git Powershell Prompt.
A developer I work with came up with this neat PowerShell profile hack. I spend most of my day in a PowerShell window, and when working with repos, it can be handy to know where you are. This profile addition replaces your PowerShell prompt with the default (the path) unless you're in a git repo, where it then adds the branch you're on.
If you don't have a profile created - run this first:
New-Item -path $profile -type file -force
then edit it using
vim $profile function prompt { write-host $pwd -NoNewLine -ForegroundColor White $branch = &git rev-parse --abbrev-ref HEAD if($branch -ne $null) { write-host "[" -NoNewLine -ForegroundColor White write-host $branch -NoNewLine -ForegroundColor Green write-host "]" -NoNewLine -ForegroundColor White } ">" }
Now you have a prompt that tells you where you are in your repositories!