Created
March 27, 2016 16:16
-
-
Save duese/01e3f8369413521e467f to your computer and use it in GitHub Desktop.
Colored prompt with git-prompt enabled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to get a git prompt: | |
source /usr/share/git/completion/git-prompt.sh | |
GIT_PS1_SHOWDIRTYSTATE=true | |
#GIT_PS1_SHOWSTASHSTATE=true | |
GIT_PS1_SHOWUNTRACKEDFILES=true | |
GIT_PS1_SHOWCOLORHINTS=true | |
# colorize bash prompt | |
# see also http://misc.flogisoft.com/bash/tip_colors_and_formatting | |
#PS1='[\u@\h \W]\$ ' # To leave the default one | |
#PS1='[\[\e[1;32m\]\u\[\e[0m\] @ \[\e[1;33m\]\h\[\e[0m\] : \[\e[0;37m\]\w\[\e[0m\]]\$ ' | |
# activate the git promt: | |
#PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ ' | |
PS1='[\[\e[1;32m\]\u\[\e[0m\] @ \[\e[1;33m\]\h\[\e[0m\] : \[\e[0;37m\]\w\[\e[0m\]$(__git_ps1 "\[\e[38;5;45m\] «%s»\[\e[0m\]")]\$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment