News for hackers. Stuff that matters.
Re:OS X Command Line Utilities by stretchwithme on Thursday May 15, 2014 @01:53PM (#7751050)
I have my current git branch display as part of my command prompt when I'm in a project directory.

parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^]/d' -e 's/ \(.*\)/(\1)/' }

export PS1="\u@\h \[\033[32m\]\$(parse_git_branch)\[\033[00m\] \W $ "

Re:OS X Command Line Utilities by finnh on Thursday May 15, 2014 @02:54PM (#7751427)
You might want __git_ps1. Similar idea, but more functionality & maintained by someone else!