Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrewslince/9164071 to your computer and use it in GitHub Desktop.
Save andrewslince/9164071 to your computer and use it in GitHub Desktop.
With the following code, we can easily get to know the branch in linux terminal. @source: http://saurab.com.np/content/show-current-git-branch-linux-terminal
$ sudo vim ~/.bashrc
# show the current git branch in linux terminal
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;33m\]$(__git_ps1 " [%s]")\[\033[0m\] \[\033[00m\]$ '
$ source ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment