Show Git Branch on Bash
Mohammad-Ali A'RÂBI

Mohammad-Ali A'RÂBI @aerabi

About: Backend Engineer @ JobRad | Docker Captain | Author of Docker & Kubernetes Security | Container Security Expert

Location:
Freiburg im Breisgau, DE
Joined:
Jun 25, 2020

Show Git Branch on Bash

Publish Date: Oct 4 '21
6 0

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

Comments 0 total

    Add comment