Check to see if you have bash or zsh.
- Type
echo $SHELL
into your terminal. - If it says
/bin/bash
, you have bash. - If it says
/bin/sh
, you have zsh.
- Run
brew update
- Run
brew install bash-git-prompt
- Add the following to your
~/.bash_profile
file (anywhere in the file):
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then
__GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
fi
if running brew update
gives you a message that's something like "command brew not found", run this command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Run this command:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"