Use the set command to set the environment variable of docker, and then gitbash will always report sh: __git_ps1: command not found.
docker
gitbash
sh: __git_ps1: command not found
After searching, there is no similar solution.
If you find inspiration on stackoverflow, just go gitbash的安装目录Gitetc搜寻了一番,找到了如下文件:bash.bashrc
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
PS1
If you find inspiration on stackoverflow, just go
gitbash
的安装目录Gitetc
搜寻了一番,找到了如下文件:bash.bashrc
There is such a line in it
I removed the # in front of
PS1
and then entered sh, and no error was reported