Skip to content

Instantly share code, notes, and snippets.

@mernen
mernen / .bashrc
Created January 15, 2009 00:41 — forked from henrik/.bashrc
Slightly optimized version, and with niftier branch indicator
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
git diff --quiet HEAD &>/dev/null
[[ $? == 1 ]] && echo "*"
}
function parse_git_branch {