Skip to content

Instantly share code, notes, and snippets.

@mnementh64
mnementh64 / .bash_profile
Created March 7, 2018 14:43 — forked from jimothyGator/.bash_profile
Display current Git branch and root directory in Mac OS X Terminal title bar.
# Add to .bash_profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
get_git_root() {
basename $(git rev-parse --show-toplevel 2> /dev/null) 2> /dev/null
}