Last active
December 14, 2015 22:08
-
-
Save markcerqueira/4bdef6cd1c1d19c1c45c to your computer and use it in GitHub Desktop.
Useful git branch stuff for your bash_profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) " | |
} | |
prom1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment