DEV Community

Mohammad-Ali A'RÂBI
Mohammad-Ali A'RÂBI

Posted on • Edited on

Show Git Branch on Bash

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

Top comments (0)