search

Home  >  Q&A  >  body text

git-bash - The solution to the problem that gitbash keeps reporting: sh: __git_ps1: command not found

Use the set command to set the environment variable of docker,
and then gitbash will always report sh: __git_ps1: command not found.

After searching, there is no similar solution.

滿天的星座滿天的星座2825 days ago1097

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-05-02 09:38:06

    If you find inspiration on stackoverflow, just go gitbash的安装目录Gitetc搜寻了一番,找到了如下文件:
    bash.bashrc

    There is such a line in it

    # Set a default prompt of: user@host, MSYSTEM variable, and current_directory
    # PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n$ '
    

    I removed the # in front of PS1 and then entered sh, and no error was reported

    reply
    0
  • Cancelreply