Check to see if you have bash or zsh.
- Type
echo $SHELLinto 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_profilefile (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"
fiif 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)"