Skip to content

Instantly share code, notes, and snippets.

View markcerqueira's full-sized avatar
📌
Join me! Pinterest is hiring!

Mark Cerqueira markcerqueira

📌
Join me! Pinterest is hiring!
View GitHub Profile
@markcerqueira
markcerqueira / .git_bash
Last active December 14, 2015 22:08
Useful git branch stuff for your bash_profile
# displays handy info when in git directories
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'
}
function parse_hg_branch {
hg branch 2> /dev/null | sed 's/..*/\ \[&\]/'
}
function prom1 {
PS1="\w\
\$(parse_git_branch)\$(parse_hg_branch) "