Tigraine
Daniel Hoelbling talks about programming

Displaying git branch in your powershell prompt

May 16th, 2010 . by Daniel Hölbling

When I started out with git I didn’t start using the commandline right away. I fiddled around with TortoiseGit and GitGui quite a bit before I found out that it’s just so much faster to do all those things from the commandline. As we all know, the windows commandline is not the most powerful thing on the planet, but I also loathe the unix commandline that comes installed with git (gitbash). Obviously, the only alternative is Powershell so I went with that and am very happy with it.

One thing though: I envied Linux users who could extend their bash prompt to display git specific information directly on the shell. Well, after a bit of digging and through some Stackoverflow articles, I managed to find this:

image

Powershell is quite extensible, and by placing a file called Microsoft.PowerSehll_profile.ps1 in your Documents\WindowsPowerShell folder you can define a function called prompt that allows you to modify your prompt text.

I’ve been using this now for quite some time, so I can’t recall where I found the script before I modified it, but here it is anyway (credit goes to whoever created it in the first place): Microsoft.PowerShell_profile.ps1.


  • http://www.moncler-down-jackets.com nike air force shoes

    thread! I'm not agree you standpoint,but toally approve your view!Anybody has his own dream,someone makes them reality , air jordan 9 another leaves it just dreams.So it lie on how hard you distribute,how long you persist! This post make a way to lead to success,ugg boots for saleany only insist on studying new knowledge and digest them for your own that can make you gradually growing up , Nike Air Force 1 Lowthank you for this outline,it will be very useful for those who are in the lost! ugg boots for sale