Last active
August 29, 2015 13:59
-
-
Save knowtheory/10547187 to your computer and use it in GitHub Desktop.
Include this in your .bash_profile to get colors, info and autocompletion on your prompt (if git is installed via homebrew)
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
# Git comes with some shell scripts you can load to get | |
# nifty shell features. Homebrew sticks them in /usr/local/etc/bash_completion.d | |
source "/usr/local/etc/bash_completion.d/git-prompt.sh" | |
source "/usr/local/etc/bash_completion.d/git-completion.bash" | |
# apparently you can specify __git_ps1 as the thing that | |
# renders your prompt by setting PROMPT_COMMAND. | |
# Setting the PROMPT_COMMAND lets git display colors. | |
# | |
# The alternative is just to set the PS1 variable. | |
# | |
# the "\u@\h:\W" "\\\$ " bit says " | |
# display the user, | |
# an @ sign, | |
# the hostname of your machine | |
# a colon | |
# the current directory | |
# and then some git stuff | |
export PROMPT_COMMAND='__git_ps1 "\u@\h:\W" "\\\$ "' | |
# and we can tell it what to show us. | |
export GIT_PS1_SHOWDIRTYSTATE=1 | |
export GIT_PS1_SHOWSTASHSTATE=1 | |
export GIT_PS1_SHOWUNTRACKEDFILES=1 | |
export GIT_PS1_SHOWUPSTREAM="auto" | |
export GIT_PS1_SHOWCOLORHINTS=true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like this: