Skip to content

Instantly share code, notes, and snippets.

@erran
Last active December 12, 2015 01:38
Show Gist options
  • Save erran/4692298 to your computer and use it in GitHub Desktop.
Save erran/4692298 to your computer and use it in GitHub Desktop.
Git prompt in .bashrc
# Git
function git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u @ \w \$(git_branch)$ "
[color]
branch = auto
diff = auto
status = auto
[core]
editor = /usr/bin/vim
[help]
autocorrect = 5
[color "branch"]
current = yellow bold
remote = cyan bold
[color "diff"]
new = yellow bold
old = red bold
meta = cyan bold
frag = white bold
commit = white bold
[color "status"]
added = yellow bold
changed = cyan bold
untracked = red bold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment