good git prompt for OSX?


[H]ard|DCer of the Month - May 2006
Jun 26, 2004
On Windows, GitHub installs a shell that has a really cool prompt. It's inside PowerShell, and looks like this:

C:\projects\my project [master +1 ~12 -0 | +1 ~0 -0 !]>

I can see how many un-tracked files there are, how many files are staged for commit, how many are to be committed, and what branch I'm on. It's quite fast; there's no delay in displaying the prompt in the shell.

I've been fussing around with my Mac, on the other hand, and I'm having a miserable time getting together a shell prompt that shows this information and isn't frustratingly slow. My most recent attempt has been with a file like this one, which I've trimmed even further to eliminate the svn and hg invocations. It still takes two to three seconds to display the prompt, and isn't nearly as functional as the PowerShell prompt back on Windows.

What can I do to track down the performance problem? How can I get a usable git prompt on Mac OSX?
I believe what you are seeing is the posh-git PowerShell environment. There is a bash port that might work in OSX bash, although I have personally never tried it.
Thanks! I got that set up with only a few tweaks.

I use a combination of:

ohmyzsh! (customized shell prompt, gives git branch, working directory on the right side)
scm_breeze (git shortcuts.. 'ga' for git add 'gl' for git log etc.)
a better git log (much better looking git log in the shell)

in linux at work. I haven't tried it on OS X though. ohmyzsh! says it works best on mac OS X though, a better git log is just some custom formatted git command I believe, and scm_breeze should work.

I think ohmyzsh has a bunch of customizations out there and themes you can check out.

oh-my-zsh themes

here's a better git log
Last edited:
Thanks, Allan. I use gitk for logs (when I need anything involved). The posh prompt really helps.
another vote for Oh My ZSH. Don't leave home without it kids. Works great on OSX as well.