Skip to content

Instantly share code, notes, and snippets.

@xaviershay
Forked from filipsalomonsson/gist:31675
Created January 20, 2009 00:54
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save xaviershay/49265 to your computer and use it in GitHub Desktop.
Save xaviershay/49265 to your computer and use it in GitHub Desktop.
function parse_git_dirty {
git diff --quiet || echo " *"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1$(parse_git_dirty))/"
}
export PS1='\w $(parse_git_branch)\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment