Skip to content

Instantly share code, notes, and snippets.

@noodlehaus
Created March 2, 2015 01:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noodlehaus/9ff0b2d4f9fa17b050bc to your computer and use it in GitHub Desktop.
Save noodlehaus/9ff0b2d4f9fa17b050bc to your computer and use it in GitHub Desktop.
bash prompt
# get bash completion for brew
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# git prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \(\1\)/'
}
# clean prompt
export PS1="\w\$(parse_git_branch) \$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment