Add colored branches on your terminal
- Locate your .bashrc
# Yes I use nano...
nano ~/.bashrc
- Copy this.
export GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWSTASHSTATE=1 GIT_PS1_SHOWUNTRACKEDFILES=1
export GIT_PS1_SHOWUPSTREAM=verbose GIT_PS1_DESCRIBE_STYLE=branch
GIT_PS1_SHOWCOLORHINTS=1
PROMPT_COMMAND='__git_ps1 "${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w" "\[\033[00m\]\$ "'
- Between the lines:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# INSERT HERE <----------------------------------------------------------
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
- Save and source your bashrc.
source ~/.bashrc
- Try it out