Skip to content

Instantly share code, notes, and snippets.

View leonardovillela's full-sized avatar

Leonardo Villela leonardovillela

  • GitHub Staff
  • Amsterdam, Netherlands
  • 04:20 (UTC +02:00)
View GitHub Profile
function git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
# http://unix.stackexchange.com/questions/88307/escape-sequences-with-echo-e-in-different-shells
function markup_git_branch {
if [[ "x$1" = "x" ]]; then
echo -e "[$1]"
else