title: Adding git-prompt to my Bash profile clobbered my Bash prompt pyenv/pyenv-virtualenv version indicator. How to restore pyenv to prompt?
body: <p>When I setup <a href="https://github.com/yyuu/pyenv" rel="nofollow">pyenv</a> + <a href="https://github.com/yyuu/pyenv-virtualenv" rel="nofollow">pyenv-virtualenv</a>, they seemed to auto-magically add the current python version name or pyvenv/virtualenv name to the command prompt. great, very useful.</p>
  
  <pre><code>if which pyenv &gt; /dev/null; then eval "$(pyenv init -)"; fi
  if which pyenv-virtualenv-init &gt; /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
  </code></pre>
  
  <p>I added <a href="https://github.com/git/git/blob/master/contrib/completion/git-completion.bash" rel="nofollow">git-completion.bash</a> and <a href="https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh" rel="nofollow">git-prompt.sh</a> to my ~/.bash_profile with </p>
  
  <pre><code># Enable tab completion
  source ~/.git-completion.bash
  
  # colors!
  red="\[\033[1;31,\]"
  green="\[\033[0;32m\]"
  blue="\[\033[0;34m\]"
  purple="\[\033[0;35m\]"
  cyan="\[\033[1;36m\]"
  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 $cyan&gt;&gt;&gt;$green\$(__git_ps1)$blue \W \$ $reset"
  </code></pre>
  
  <p>Regardless of the order, the pyenv is not included in the prompt. I had been hoping pyenv was just tacking onto whatever the prompt string was set to such that including it after the git stuff would allow it to insert itself.</p>
  
  <p>I have tried include the pyenv code above the git stuff and then capture the <code>$pyenv local</code> output and add it as a variable but my Bash skills are wanting. I went hunting in the pyenv code for the shell prompt export code but again, Bash skills are wanting.</p>
  
  <p>Is there a right way to recapture/insert the pyenv version back into the prompt?</p>
  
  <p>I am was attempting to get something along the lines of: </p>
  
  <pre><code>\u(username) &gt;&gt;&gt; (pyenv/py(venv)-version) | (__git_ps1) | \w(pwd) \$
  </code></pre>
  
  <p>Thanks,</p>