Skip to content

Instantly share code, notes, and snippets.

@jonykalavera
Last active April 26, 2016 23:56
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 jonykalavera/5075128 to your computer and use it in GitHub Desktop.
Save jonykalavera/5075128 to your computer and use it in GitHub Desktop.
Kalavera Custom Prompt with git branch
#custom prompt
export PS1='\[\e[01;30m\]\t`if [ $? = 0 ]; then echo "\[\e[32m\] ✔ "; else echo "\[\e[31m\] ✘ "; fi`\[\e[00;37m\]\u\[\e[01;37m\]:`[[ $(git status 2> /dev/null | head -n2 | tail -n1) != "# Changes to be committed:" ]] && echo "\[\e[31m\]" || echo "\[\e[33m\]"``[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] || echo "\[\e[32m\]"`$(__git_ps1 "(%s)\[\e[00m\]")\[\e[01;34m\]\w\[\e[00m\]\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment