Skip to content

Instantly share code, notes, and snippets.

@ghoneycutt
Created March 20, 2015 08:40
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 ghoneycutt/3c3bf19ba55063140855 to your computer and use it in GitHub Desktop.
Save ghoneycutt/3c3bf19ba55063140855 to your computer and use it in GitHub Desktop.
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
export SPEC_OPTS="--format documentation"
source $HOME/.git_bash_completion
# change prompt when using git
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
if [ $EUID == '0' ]; then
PS1="\[\e[32m\]\$(parse_git_branch)\[\e[m\]\h:\W # "
else
PS1="\[\e[32m\]\$(parse_git_branch)\[\e[m\]\h:\W\$ "
fi
export PS1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment