I want to have git branch information but if I write the below code to the bash_local, I lose the original setting. How do I keep the original setting and incorporate the following code? The below code is from "software carpentry".
Set the prompt to show the current git branch:
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
PS1="\h:\W$RED $(parse_git_branch)$NO_COLOR $"