Skip to content

Instantly share code, notes, and snippets.

@squid314
Created January 24, 2014 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save squid314/8607384 to your computer and use it in GitHub Desktop.
Save squid314/8607384 to your computer and use it in GitHub Desktop.
# git stuff (pulled from https://github.com/git/git/tree/master/contrib/completion)
if [ -f ~/.git-completion.bash ] ; then . ~/.git-completion.bash ; fi
if [ -f ~/.git-prompt.sh ] ; then . ~/.git-prompt.sh ; fi
# see .git-prompt.sh for explanation of the (and other) options
export GIT_PS1_SHOWDIRTYSTATE=true GIT_PS1_SHOWSTASHSTATE=true GIT_PS1_SHOWUPSTREAM=auto
# append history file after each command and execute the git PS1 embed generator
PROMPT_COMMAND='history -a ; MY_GIT_PS1="`__git_ps1`"'
# better prompt (window title gets directory and git info, nice colors, last cmd status indicator)
PS1='\[\e]0;\w$MY_GIT_PS1\007\e[0;1;34m\]\u \[\e[32m\]\w$MY_GIT_PS1 `[ $? -eq 0 ]&&echo ":)\[\e[0;31"||echo "\[\e[31m\]:(\[\e[21"`m\] \$\[\e[0m\] '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment