× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Add colors and show git branches in your bash terminal (OSX)

Federico Ulfo
Mar 04, 2016
<p>Add the following lines into your ~/.bash_profile file to make your terminal more colorful and also to display the current git branch in your working directory, very very useful.</p> <pre># colors PS1='\w\[\033[0;32m\]$( git branch 2&gt; /dev/null | cut -f2 -d\* -s | sed "s/^ / [/" | sed "s/$/]/" )\[\033[0m\] \$ ' # Tell grep to highlight matches export GREP_OPTIONS='--color=auto' # Tell ls to be colourful export CLICOLOR=1 export LSCOLORS=Exfxcxdxbxegedabagacad</pre> <p><br> You can add those line with vi ~/.bash_profile.<br> <br> Please reach out to me for any question, I'll be happy to help!</p>
comments powered by Disqus