Show Git Branch on Bash

Mohammad-Ali A'RÂBI - Oct 4 '21 - - Dev Community

bash

TL;DR

Add the following line to end of your .bashrc to make your bash show the current branch you're on:

PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\e[91m\]\$(__git_ps1 ' [%s]')\[\e[00m\]\$ "
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . .
Terabox Video Player