DivineRails

Ruby on Rails

Blog

Show Branch name in Terminal

Posted by Jamal Nasir on February 14, 2012 at 8:50 AM

If you switch branches oftenly and you don't know in which branch you are in currently. Then run the following

lines in the terminal which will show you the current branch name...

source /etc/bash_completion.d/git
PS1='\[$(tput setaf 3)\]\u@\h:\[$(tput sgr0)$(tput setaf 5)\]\w\[$(tput sgr0)$(tput setaf 2)\] $(__git_ps1 "[%s]") \[$(tput sgr0)\]$ '


Categories: None

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

Already a member? Sign In

1 Comment

Reply Rq Bukhari
3:58 AM on February 27, 2012 
Hey,

Nice post. Thanks for sharing. Keep it up..