Skip to content

Instantly share code, notes, and snippets.

@nalanj
Created April 9, 2009 12:27
Show Gist options
  • Save nalanj/92436 to your computer and use it in GitHub Desktop.
Save nalanj/92436 to your computer and use it in GitHub Desktop.
# My command prompt, ripped from someone online that I don't have a link for. Sorry!
function git_current_branch {
git branch 2>/dev/null | awk '/^\* /{print " " $2}'
}
function git_dirty {
git status 2>/dev/null | wc -l | awk '{if ($1 > 2) print "*"}'
}
export PS1="[\w\$(git_current_branch)\$(git_dirty)]: "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment