Skip to content

Instantly share code, notes, and snippets.

@jhammann
Created January 12, 2018 15:47
Show Gist options
  • Save jhammann/e330e2fc84378a3e71dc3f03a0847e49 to your computer and use it in GitHub Desktop.
Save jhammann/e330e2fc84378a3e71dc3f03a0847e49 to your computer and use it in GitHub Desktop.
Bash profile snippets
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
source /usr/local/git/contrib/completion/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
PS1="\[\e[30;46m\] \u \[\e[0m\]\[\e[30;42m\] \W \[\e[0m\]\[\e[37;45m\]\$(__git_ps1 ' ⑂ %s ')\[\e[0m\] $ "
# Git branch autocompletion
test -f ~/.git-completion.bash && . $_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment