Skip to content

Instantly share code, notes, and snippets.

@JulianJorgensen
Created November 12, 2014 17:39
Show Gist options
  • Select an option

  • Save JulianJorgensen/e70f26a6aeb6f5df6c2e to your computer and use it in GitHub Desktop.

Select an option

Save JulianJorgensen/e70f26a6aeb6f5df6c2e to your computer and use it in GitHub Desktop.
Terminal branch highlight
# git branch highlighting
function parse_git_branch
{
branch=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'`
if [ -n "$branch" ]; then
echo "${branch} "
fi
}
function proml
{
local WHITE="\[\033[1;37m\]"
local LIGHT_GREY="\[\033[0;37m\]"
local RED="\[\033[0;31m\]"
PS1="$RED\$(parse_git_branch)$LIGHT_GREY\w\$ "
}
proml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment