Skip to content

Instantly share code, notes, and snippets.

@jmhodges
Created November 29, 2008 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmhodges/30224 to your computer and use it in GitHub Desktop.
Save jmhodges/30224 to your computer and use it in GitHub Desktop.
# This assumes you've already got the stuff from git-completion.bash source'd in.
git_dirty_status ()
{
local gitstat="$(git status 2>/dev/null)"
local dirty="$(echo $gitstat | grep 'added to commit' 2>/dev/null)"
if [ -n "$dirty" ]; then
printf " ⚡"
fi
}
export PS1='\u @ \h: \w $(__git_ps1 " (%s) ")$(git_dirty_status)\n→ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment