Highlights: I came across nice utility vcprompt which shows the git source control information in Mac OS bash terminal.
Steps:
Install vcprompt using brew
brew install vcprompt
Now Add this code in .bashrc file in your home directory
You can search for different colors and use those as variables with “$” prefix.
You can pass different format options for vcprompt -f flag.
NO_COLOR='\e[0m'
RED='\e[0;31m'
export PS1="\n\u:\w \[$RED\] \$(vcprompt -f [%b])\[$NO_COLOR\] \n→ "
Once you are done with above changes, either restart the terminal or run the command to load configuration file.
source ~/.bashrc
Result: Now You will see the project current branch and other information when you navigate to a folder which is under source control.