Add colored branches on your terminal
Find a file
Bernard Joseph Jean Bruno eae064f5a8
Update README.md
2022-09-22 20:36:26 +04:00
README.md Update README.md 2022-09-22 20:36:26 +04:00

git_colors

Add colored branches on your terminal

  1. Locate your .bashrc
# Yes I use nano...
nano ~/.bashrc 
  1. 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\]\$ "'
  1. 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
  1. Save and source your bashrc.
source ~/.bashrc
  1. Try it out