Your Bash Prompt with Git Info
########################################
# Start : Your Bash Prompt with Git Info
########################################
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
txtrst="\[\e[0m\]"
# More Color Code https://wiki.archlinux.org/index.php/Color_Bash_Prompt
PS1="[\u@\h \W$GREEN\$(parse_git_branch)$txtrst]\$ "
########################################
# End : Your Bash Prompt with Git Info
########################################
########################################
# Start : Your Bash Prompt with Git Info
########################################
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
txtrst="\[\e[0m\]"
# More Color Code https://wiki.archlinux.org/index.php/Color_Bash_Prompt
PS1="[\u@\h \W$GREEN\$(parse_git_branch)$txtrst]\$ "
########################################
# End : Your Bash Prompt with Git Info
########################################
No comments:
Post a Comment