Steps to Reproduce:
# Enable tab completion
source ~/git-completion.bash
# colors!
green="\[\033[0;32m\]"
blue="\[\033[0;34m\]"
purple="\[\033[0;35m\]"
reset="\[\033[0m\]"
# Change command prompt
source ~/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
# '\u' adds the name of the current user to the prompt
# '\$(__git_ps1)' adds git-related stuff
# '\W' adds the name of the current directory
export PS1="$purple\u$green\$(__git_ps1)$blue \W $ $reset"

Note, the system terminal does not have this error and properly displays __git_ps1

By default the VS Code integrated terminal does not run as a login shell and therefore does not run ~/.bash_profile, have you got this in your settings.json?
"terminal.integrated.shellArgs.osx": ["-l"]
That fix works! Thanks @Tyriar.
Good to hear :smiley:
Most helpful comment
By default the VS Code integrated terminal does not run as a login shell and therefore does not run
~/.bash_profile, have you got this in your settings.json?