Skip to content

Instantly share code, notes, and snippets.

@agieche
Last active December 21, 2015 13:59
Show Gist options
  • Save agieche/6316737 to your computer and use it in GitHub Desktop.
Save agieche/6316737 to your computer and use it in GitHub Desktop.
Prettify your bash and show the current git branch and time on your command line. (Just paste into your .bash_profile) Preview: (12:24:36) myproject::master *$> Inspired by: http://digitalformula.net/articles/pimp-my-prompt-like-paul-irish/
# enable git unstaged indicators - set to a non-empty value
GIT_PS1_SHOWDIRTYSTATE="."
# enable showing of untracked files - set to a non-empty value
GIT_PS1_SHOWUNTRACKEDFILES="."
# enable stash checking - set to a non-empty value
GIT_PS1_SHOWSTASHSTATE="."
# enable showing of HEAD vs its upstream
GIT_PS1_SHOWUPSTREAM="auto"
BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
LIME_YELLOW=$(tput setaf 190)
POWDER_BLUE=$(tput setaf 153)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
WHITE=$(tput setaf 7)
BRIGHT=$(tput bold)
NORMAL=$(tput sgr0)
BLINK=$(tput blink)
REVERSE=$(tput smso)
UNDERLINE=$(tput smul)
PS1='\n\n${NORMAL}${CYAN}(`date "+%H:%M:%S"`) ${RED}\W${YELLOW}${WHITE}`__git_ps1 "::${GREEN}%s"`${WHITE}\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment