Skip to content

Instantly share code, notes, and snippets.

@ohookins
Last active August 29, 2015 14:08
Show Gist options
  • Save ohookins/3567bbb86b1a0bd9c4a0 to your computer and use it in GitHub Desktop.
Save ohookins/3567bbb86b1a0bd9c4a0 to your computer and use it in GitHub Desktop.
# Git completions
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh
# Show git branch name in prompt
function smiley() {
if [ $? -eq 0 ]; then
echo -en '\033[32m:)\033[00m'
else
echo -en '\033[31m:(\033[00m'
fi
}
export PS1="\[\$(smiley)\] \u \[\033[34m\]\w\[\033[31m\]\[\$(__git_ps1)\]\[\033[37m\]$\[\033[00m\] "
alias short='export PS1="$ "'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment