Skip to content

Instantly share code, notes, and snippets.

@jlr7245
Last active July 7, 2020 21:36
Show Gist options
  • Save jlr7245/24b3366547393fb3b236b96da26db717 to your computer and use it in GitHub Desktop.
Save jlr7245/24b3366547393fb3b236b96da26db717 to your computer and use it in GitHub Desktop.
git prompt

MAKING YOUR COMMAND LINE PRETTY

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.

IF YOU HAVE BASH

  • 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)"

IF YOU HAVE ZSH

Run this command:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment