Skip to content

Instantly share code, notes, and snippets.

Avatar

Andy Barron andybarron

View GitHub Profile
@andybarron
andybarron / add_to_bashrc.bash
Last active Feb 26, 2018
awesome terminal prompt
View add_to_bashrc.bash
# special thanks to ezprompt.net
# colors stolen from misc.flogisoft.com/bash/tip_colors_and_formatting
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo " [${BRANCH}${STAT}]"