Skip to content

Instantly share code, notes, and snippets.

@guenter
Created December 10, 2013 01:03
Show Gist options
  • Save guenter/7884094 to your computer and use it in GitHub Desktop.
Save guenter/7884094 to your computer and use it in GitHub Desktop.
Show git branch in prompt
# Git
source /usr/local/etc/bash_completion.d/git-prompt.sh
if [ "$USER" = "root" ]; then
PS1='\e[1;31m[\u@\h \W[\033[34m\]$(__git_ps1 " (%s)")\[\033[00m\]\$\e[0m '
else
PS1='\u@\h \w$(__git_ps1 " (%s)")\$ '
fi
alias g='git'
alias gpr='git pull --rebase'
alias gp='git push'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment