Last active
March 24, 2016 17:27
-
-
Save ksylvan/40edde47602b9087d8c4 to your computer and use it in GitHub Desktop.
bash completion for git for Mac OSX
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
# /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# brew install bash-completion git git-extras git-flow | |
# Then add the following snippet to your .bash_profile | |
if [ -f $(brew --prefix)/etc/bash_completion ]; then | |
. $(brew --prefix)/etc/bash_completion | |
fi | |
if [ -d $(brew --prefix)/bin ]; then | |
PATH=$(brew --prefix)/bin:$PATH | |
fi | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\h:\W \u\$(parse_git_branch)\$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment