Skip to content

Instantly share code, notes, and snippets.

@gnepud
Last active October 5, 2015 17:18
Show Gist options
  • Save gnepud/2843503 to your computer and use it in GitHub Desktop.
Save gnepud/2843503 to your computer and use it in GitHub Desktop.
Show the current git branch in terminal
# Show the current git branch in terminal
COLOR_RESET="\e[0m"
RED="\e[1;31m"
YELLOW="\e[1;33m"
GREEN="\e[1;32m"
CYAN="\e[1;36m"
PS1="\[$YELLOW\]\u \[$COLOR_RESET\]at \[$CYAN\]\h \[$RED\]\W"
PS1+='$(__git_ps1 " \[$GREEN\](%s)") '
PS1+="\[$COLOR_RESET\]\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment