Created
August 1, 2017 15:36
-
-
Save gaieges/7e05a6ab0c1d892c97be9cd5cd8dfb6e to your computer and use it in GitHub Desktop.
bash-git-prompt
This file contains hidden or 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
# need brew package 'bash-git-prompt' for this to work | |
# brew install bash-git-prompt | |
# this is just my custom colorization, they have themes available too if you look at the git repo: | |
# https://github.com/magicmonty/bash-git-prompt | |
GIT_PROMPT_START="\[\033[0;33m\][\D{%m-%d} \t \!] \`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u@\h:\`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\[\033[0m\]"; echo -ne "\033]0;`hostname -s`:`pwd`\007" | |
GIT_PROMPT_END="\n\$ " | |
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then | |
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
~/.bash_profile
source ~/.bash_profile