Last active
August 29, 2015 13:56
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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