Over a million developers have joined DZone.
Platinum Partner

-bash: __git_ps1: Command Not Found

· DevOps Zone

The DevOps Zone is brought to you in partnership with HPE.  Learn about the seven KPI’s that create the foundation of DevOps metrics and how it continues to evolve as the DevOps Methodology becomes more engrained in enterprises.  

Today I updated mac ports and a new error started to show up at the command line saying that the __git_ps1 command is not found.

This is because I added the git branch in my bash prompt long time back and in last update of git-core port they moved the __git_ps1 bash functions to a separate script.

To fix it, you just need to include following lines in your .profile (or .bashrc):

if [ -f /opt/local/share/doc/git-core/contrib/completion/git-prompt.sh ]; then
    . /opt/local/share/doc/git-core/contrib/completion/git-prompt.sh
fi

It worked for me.

Depending on your git installation, this file may be located elsewhere; find command should help in this case.

The DevOps Zone is brought to you in partnership with HPE.  Discover the Top 5 predictions for DevOps and the central role they will play as enterprises begin to modernize legacy applications.

Topics:

Published at DZone with permission of Luigi Viggiano , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}