Skip to content

Instantly share code, notes, and snippets.

@americos
Created July 31, 2014 17:20
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 americos/462e4d3f6487d542d9cd to your computer and use it in GitHub Desktop.
Save americos/462e4d3f6487d542d9cd to your computer and use it in GitHub Desktop.
My bash Terminal
##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\]"
@americos
Copy link
Author

Place the above text inside your ~/.bash_profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment