Download git-prompt.sh
cd ~wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -O .git-prompt.shEdit .bashrc
nano ~/.bashrcAdd the following at the end of the file
source ~/.git-prompt.shPS1='[\u@\h:\w$(__git_ps1 " (%s)")]\$ 'NOTE: You can customize the bash prompt/PS1.
Start a new command prompt or run
source .bashrcNOTE: You might want to look into bash-git-prompt for a more fancy bash prompt for git.