Skip to content

Instantly share code, notes, and snippets.

@joelstransky
Created December 6, 2017 17:59
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 joelstransky/df2948853d4cb8d391d9586ec1780983 to your computer and use it in GitHub Desktop.
Save joelstransky/df2948853d4cb8d391d9586ec1780983 to your computer and use it in GitHub Desktop.
Add git branch to front of cli prompt.
PS1='`__git_ps1 "[%s] "`\u:\[$(tput sgr0)\]\[\033[38;5;45m\]\W\[$(tput sgr0)\]\[\033[38;5;15m\]\\$\[$(tput sgr0)\] '
if [ -f `brew --prefix`/etc/bash_completion.d/git-completion.bash ]; then
. `brew --prefix`/etc/bash_completion.d/git-completion.bash
fi
if [ -f `brew --prefix`/etc/bash_completion.d/git-prompt.sh ]; then
. `brew --prefix`/etc/bash_completion.d/git-prompt.sh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment