git_prompt(){branch=$(__git_ps1 | sed 's/[ ()]//g')if[ ! -z $branch];thenif["$(git status 2>/dev/null | tail -n1)" !="nothing to commit, working tree clean"];thendirty="*"fiecho" ($branch$dirty)"fi}exportPS1="[\[\033[1;36m\]\u\[\033[1;33m\] \[\033[32m\]\w\[\033[0m\]]\$(git_prompt)$ "
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.