Skip to content

Instantly share code, notes, and snippets.

# This script, whose origin has been lost, will output the current branch and change status in your bash prompt.
# See http://www.incaseofstairs.com/2013/01/osx-frontend-toolchain/
#
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function last_two_dirs {
pwd |rev| awk -F / '{print $1,$2}' | rev | sed s_\ _/_
}