Skip to content

Instantly share code, notes, and snippets.

@skreutzberger
Created November 3, 2011 07:48
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 skreutzberger/1335993 to your computer and use it in GitHub Desktop.
Save skreutzberger/1335993 to your computer and use it in GitHub Desktop.
Custom Terminal Prompt
# add the following block to your ~/.bash_profile
# it will print more information and an extra char at the new line
# you can also use the Apple logo as character, just replace ⌘ with 
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
GREEN="\[\033[0;32m\]"
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
WHITE="\[\033[01;37m\]"
RESET="\[\033[00m\]"
export PS1="\u@\h${GREEN}\$(parse_git_branch)${RESET}:$YELLOW\w$RESET\n${WHITE}${RESET}⌘ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment