Skip to content

Instantly share code, notes, and snippets.

@gustoase
Last active April 10, 2018 18:26
Show Gist options
  • Save gustoase/b229ab559cde78da6ccf18475acc0417 to your computer and use it in GitHub Desktop.
Save gustoase/b229ab559cde78da6ccf18475acc0417 to your computer and use it in GitHub Desktop.
Add colors and show git branches in your bash terminal (OSX)
# colors
PS1='\w\[\033[0;32m\]$( git branch 2> /dev/null | cut -f2 -d\* -s | sed "s/^ / [/" | sed "s/$/]/" )\[\033[0m\] \$ '
# Tell grep to highlight matches
export GREP_OPTIONS='--color=auto'
# Tell ls to be colourful
export CLICOLOR=1
export LSCOLORS=Exfxcxdxbxegedabagacad
# You can add those line with vi ~/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment