Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

terminal issue

I am getting this line before every new command line entry: -bash: __git_ps1: command not found

this is what it looks like when I am in terminal:

-bash: __git_ps1: command not found [23:36:19][example@name-iMac ~]$ rails -v Rails 3.2.11 -bash: __git_ps1: command not found [23:36:26][example@name-iMac ~]$ ruby -v ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-darwin12.2.0] -bash: __git_ps1: command not found [23:36:31][example@name-iMac ~]$

I need to understand how to get this to stop and what is happening here!

8 Answers

Nick Pettit
STAFF
Nick Pettit
Treehouse Teacher

Hi William,

I've pinged Jim so that he can take a look and get you the answer to this. Sorry for the confusion and thank you for your patience!

Hi William,

Is this an issue on your local terminal, or are you using the Treehouse Command Line? Looking at your output it appears you are on a mac. I'm not sure what is going on but by googling the error, I found this page, which should point you in the right direction.

http://stackoverflow.com/questions/12870928/mac-bash-git-ps1-command-not-found

Hope that helps.

@William -

Post the output of from these commands:

echo $PS1
git --version

Remember to indent each line of the output with 4 spaces so the forum correctly formats the output.

echo $PS1

\[\033[0;37m\][\t\[\033[0;37m\]]\[\033[0;33m\][\[\033[0;36m\]\u\[\033[0;36m\]@\
[\033[0;36m\]\h \[\033[0;32m\]\w\[\033[0;33m\]]\[\033[0;31m\]$(__git_ps1 "(%s)")\
[\033[0;37m\]\\$ \[\033[00m\]
-bash: __git_ps1: command not found

git --version

git version 1.7.4.4
-bash: __git_ps1: command not found

Enter the following commands in your terminal:

  • Open up your bash porfile

    nano ~/.bash_profile

  • Add this to the end of the file

source /usr/local/git/contrib/completion/git-completion.bash
source /usr/local/git/contrib/completion/git-prompt.sh
  • Save the file

Press ctrl + o keys at the same time

  • Exit nano

Press ctrl + o keys at the same time

source: http://stackoverflow.com/a/11405709/1756132

So where am I putting this?

Thanks that work perfect!

@William -

Glad to help. Let us know if you have any other questions.