Skip to content

Instantly share code, notes, and snippets.

@peterroth
Created September 21, 2020 21:17
Show Gist options
  • Save peterroth/262281a78bbf04e7335e48415a9e3465 to your computer and use it in GitHub Desktop.
Save peterroth/262281a78bbf04e7335e48415a9e3465 to your computer and use it in GitHub Desktop.
Bash profile to show git branch in the prompt in a git directory
function parse_git_branch {
   git branch --show-current --no-color 2> /dev/null | sed 's/^/ /'
}

export PS1="\[\033[01;32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\]: "
export CLICOLOR=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment