首页 > 关于gitbash一直报:sh: __git_ps1: command not found的解决办法

关于gitbash一直报:sh: __git_ps1: command not found的解决办法

在使用set命令设置docker的环境变量,
然后gitbash一直报sh: __git_ps1: command not found

搜索了一番,并没有相似的解决办法。


在stackoverflow上找到灵感,就去gitbash的安装目录\Git\etc搜寻了一番,找到了如下文件:
bash.bashrc

其中有这么一行

# 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\$ '

我把PS1前面的#去掉,然后在输入sh,就没有报错了

【热门文章】
【热门文章】