Skip to content

Instantly share code, notes, and snippets.

@gabssnake
Created December 6, 2013 09:27
Show Gist options
  • Save gabssnake/7820969 to your computer and use it in GitHub Desktop.
Save gabssnake/7820969 to your computer and use it in GitHub Desktop.
Some colors git autocompletion for .bash_profile
# turn on colors
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxGxGx
# used to get the current git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# add autocompletion for git
source ~/.git-completion.bash
# gabs
export PS1="\[\e[0;36m\]\u \[\e[0;34m\]\w\[\e[0;32m\]\$(parse_git_branch) \[\e[0;34m\]$ \[\e[m\]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment