Skip to content

Instantly share code, notes, and snippets.

@reecefowell
Created January 23, 2013 06:25
Show Gist options
  • Save reecefowell/4602582 to your computer and use it in GitHub Desktop.
Save reecefowell/4602582 to your computer and use it in GitHub Desktop.
Git Bash Colours 2.0
parse_git_branch () {
#git name-rev HEAD 2> /dev/null | sed -e 's/\^0$//' | sed 's#HEAD\ \(.*\)# (\1)#'
#git diff --shortstat
#git show --raw --abbrev-commit --date=local
#BR=$(git log --oneline -n 3 2>/dev/null) || { echo "$@"; exit; }
#br=$(git log --oneline -n 5 2>&1) || br=""
xr=$(git diff HEAD --stat 2>&1) || xr=""
br=$(git ph -n 7 2>&1) || br=""
echo "$xr"
echo "$br"
# $key == "\n"
#git log --online -n 3 2>/dev/null;
}
BLACK="\[\033[0;38m\]"
RED="\[\033[0;31m\]"
RED_BOLD="\[\033[01;31m\]"
BLUE="\[\033[01;34m\]"
GREEN="\[\033[0;32m\]"
BLACK="\[\033[0;38m\]"
RED="\[\033[0;31m\]"
RED_BOLD="\[\033[01;31m\]"
BLUE="\[\033[01;34m\]"
GREEN="\[\033[0;32m\]"
# PS2: shown while waiting for input (interactive)
export PS2="$GREEN\w$BLACK "
# PS1: standard shell prompt
export GIT_PS1_SHOWUPSTREAM="auto verbose"
export GIT_PS1_SHOWDIRTYSTATE="yes"
export GIT_PS1_SHOWSTASHSTATE="yes"
export GIT_PS1_SHOWUNTRACKEDFILES="yes"
export PS1="$GREEN\w$BLACK$RED_BOLD\$(__git_ps1)$RED\n\$(parse_git_branch)\n$GREEN~ $BLACK"
#export PS1="sh ~/.readprompt"
#export PS1="$BLACK\u@\h:$GREEN\w $RED_BOLD\$(parse_git_branch)$BLACK "
#export PS1="$GREEN\w$BLACK$RED_BOLD\$(parse_git_branch)$BLACK "
source ~/.git-prompt.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment