Skip to content

Instantly share code, notes, and snippets.

@bsag
bsag / .bashrc
Created January 15, 2009 19:07 — forked from henrik/.bashrc
# 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
# bsag: I combined the best of both worlds and used the parse_git_dirty function here:
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/#comment-4166
# as well as various other mods from the forks of this gist.
function parse_git_dirty {
git diff --quiet HEAD &>/dev/null