Created
July 31, 2014 17:20
-
-
Save americos/462e4d3f6487d542d9cd to your computer and use it in GitHub Desktop.
My bash Terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Based on: https://gist.github.com/871284e41058014863e0 | |
MAGENTA="\033[1;31m" | |
ORANGE="\033[1;33m" | |
GREEN="\033[1;32m" | |
PURPLE="\033[1;35m" | |
WHITE="\033[1;37m" | |
BOLD="" | |
RESET="\033[m" | |
parse_git_dirty () { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*" | |
} | |
parse_git_branch () { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" | |
} | |
PS1=" \[\e[36;1m\]-> \[$WHITE\]\W\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" [\")\[$PURPLE\]\$(parse_git_branch)\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \"]\"): \[$RESET\]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Place the above text inside your
~/.bash_profile