Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am joshp on github.
  • I am joshportner (https://keybase.io/joshportner) on keybase.
  • I have a public key ASA5Xymq1wjMEYtLwoiVaBfWM2tNoHZX_TlM2Ck1i8FG9go

To claim this, I am signing this object:

@JoshP
JoshP / .bashrc
Created March 17, 2011 21:31
adds branch name in red/green based on any changes in git
c_cyan=`tput setaf 6`
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_sgr0=`tput sgr0`
parse_git_branch ()
{
if git rev-parse --git-dir >/dev/null 2>&1
then
gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')