vaiwa
4/25/2015 - 7:07 PM

git terminal

git terminal

Zobrazování GIT Branche v Terminálovém Prompt. Pridej do .bashrc:

parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}

# promt with color
COL0="\[\033[0m\]"
COL1="\[\033[0;33m\]"
COL2="\[\033[1;33m\]"
export PS1="$COL1\u@\h:\w $COL2\$(parse_git_branch)$COL0> "
# prompt no color
export PS1="\u@\h:\w \$(parse_git_branch)> "