bash __git_ps1 command not found

I am a beginner trying to setup a developer environment on my new Mac following the steps from this link:

After executing the files from git, my terminal window now shows:

  • Can't add a file separated with space to git
  • Where can I get the fmt binary for MSYS/MinGW?
  • How to show git status info on the right side of the terminal?
  • Git Bash is displaying strange characters on Windows 7
  • Why is this a bad config line for my .gitconfig?
  • How to detect if a git clone failed in a bash script
  • rbenv: version `1.9.3-p194' not installed
    -bash: __git_ps1: command not found

    The first line only shows when I open a new terminal window, while the second shows everytime I press return no matter what I type into the terminal.

    I have read through many questions on stackoverflow and tried to mimic their solutions to no avail. I think I’ve made a mistake in installing the package from git as I am not so experienced and I think now I may have messed up the configurations, and was also wondering if there is any way to go back to default settings for bash?

    Many thanks!

  • git-filter-branch: leave directory structure
  • Why don't Git refs have a file extension
  • Is there a way to make git auto generate a version number file for a --version option?
  • Is there Environment variable for Amazon ElasticBeanstalk containers for the deployed version?
  • Difference between author and committer in Git?
  • How to do a GitHub pull request
  • One Solution collect form web for “bash __git_ps1 command not found”

    If you’ve not installed a newer version of Git on your Mac, start by doing that. You can grab the download from here:

    Once it’s installed, you should source and from your ~/.profile (or ~/.bashrc, if you have it):

    source /usr/local/git/contrib/completion/git-completion.bash
    source /usr/local/git/contrib/completion/

    That should fix the __git_ps1 error.

    I’m not a Rubyist, but the rbenv error is coming from the fact that the setup in the dotfiles you are following is trying to set the default Ruby version to “1.9.3-p194”. The rbenv tool is there to make a number of different Ruby versions available, but you have to install them first. In your case, I think you need to run this:

    rbenv install 1.9.3-p194

    After that, the version will be available, and you shouldn’t see the warning anymore.

    Git Baby is a git and github fan, let's start git clone.