Add git branch name to bash prompt

edit ~/.bash_profile

if [ -f $(xcode-select -p)/usr/share/git-core/git-completion.bash ]; then
    . $(xcode-select -p)/usr/share/git-core/git-completion.bash
    . $(xcode-select -p)/usr/share/git-core/git-prompt.sh
fi

#enables color in the terminal bash shell
export CLICOLOR=1

#sets up the color scheme for list
export LSCOLORS=ExFxCxDxBxegedabagacad

#sets up the prompt color (currently a green similar to linux terminal)
export PS1='\n\[\e[1;30m\]┌─\[\e[0m\]\[\e[01;343m\]\u@\h\[\e[00m\]:\[\e[01;34m\]\w\[\e[00m\]\n\[\e[1;30m\]└──\[\e[0m\]\$ \[\e[00;33m\]$(__git_ps1 "(%s)")\[\e[00m\]'

#enables color for iTerm
export TERM=xterm-color

This entry was posted in CentOS, Git, Linux, Mac, Ubuntu. Bookmark the permalink.