Skip to content

Instantly share code, notes, and snippets.

@cmwright
cmwright / .git-coloring.bash
Last active December 14, 2015 23:09
Colored PS1 with git branch name based on whether current branch is dirty
# based on http://lancespeelmon.wordpress.com/2012/05/10/three-tips-for-creating-the-best-ever-git-command-line/
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