From 45de81964c94b32c225b378dc24f70fdb0e5002f Mon Sep 17 00:00:00 2001 From: Meutel Date: Tue, 8 Mar 2016 19:41:15 +0100 Subject: [PATCH] bash: git prompt configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pré-commande bash couleur info stash, untrack, branch --- _bashrc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/_bashrc b/_bashrc index baf27aa..03731ff 100644 --- a/_bashrc +++ b/_bashrc @@ -32,8 +32,7 @@ xterm-color) ;; esac -# Comment in the above and uncomment this below for a color prompt -#PS1='${debian_chroot:+($debian_chroot)}\[\033[0;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]\n\$ ' +# Prompt PS1="\[\033[1;31m\]>> \[\033[01;37m\](\[\033[0;37m\]\u@\[\033[0;32m\]\h\[\033[01;37m\]) \[\033[01;34m\]\w\[\033[00m\]\n\[\033[1;31m\]>>\[\033[0;37m\] " # If this is an xterm set the title to user@host:dir @@ -98,3 +97,17 @@ export YDL_TARGET=$HOME if [ -f ~/.bashrc_$(hostname -s) ]; then . ~/.bashrc_$(hostname -s) fi + +# git +if [ -e /usr/local/share/git-core/contrib/completion/git-completion.bash ]; then + . /usr/local/share/git-core/contrib/completion/git-completion.bash +fi +if [ -e /usr/local/share/git-core/contrib/completion/git-prompt.sh ]; then + . /usr/local/share/git-core/contrib/completion/git-prompt.sh + export GIT_PS1_SHOWDIRTYSTATE=1 + export GIT_PS1_SHOWSTASHSTATE=1 + export GIT_PS1_SHOWUNTRACKEDFILES=1 + export GIT_PS1_SHOWUPSTREAM="auto" + export GIT_PS1_SHOWCOLORHINTS=1 + export PROMPT_COMMAND='__git_ps1 "\[\033[1;31m\]>> \[\033[01;37m\](\[\033[0;37m\]\u@\[\033[0;32m\]\h\[\033[01;37m\]) \[\033[01;34m\]\w\[\033[00m\]" "\n\[\033[1;31m\]>>\[\033[0;37m\] "' +fi