【问题标题】:__git_ps1: command not found__git_ps1:找不到命令
【发布时间】:2018-07-31 20:38:14
【问题描述】:

(是的,我知道,有类似的问题,但他们都没有帮助我)。

前置条件: 我想“从 Windows”(8.1)构建 docker 容器。 我安装/做了:

  • 泊坞窗工具
  • 将 .sh 添加到 PATH 变量中
  • gitbash
  • 我运行了 docker quickstart 终端,并打开了 gitbash

流程: 1)我刚刚使用 Dockerfile 签出所需的项目,并尝试使用

构建(在 power shell 或 git bash 中)
$docker build -t IMAGENAME .

它在“步骤”之一上失败了

/bin/sh: /app/dirname/update.sh: not found

2) 如果我只是想跑步

$sh

来自 git bash,主题中提到的失败

sh: __git_ps1: command not found

任何想法如何解决这个问题?提前致谢。

【问题讨论】:

    标签: docker sh git-bash


    【解决方案1】:

    我今天遇到了同样的问题。我找到了这个链接https://dzone.com/articles/bash-gitps1-command-not-found。由于我使用的是 Windows 8 并使用 git-bash,因此我在 %USERHOME%/.bash.rc 文件中执行了此操作:

    if [ -f /c/Users/me/AppData/Local/Programs/Git/mingw64/share/git/completion/git-prompt.sh ]; then
    . /c/Users/me/AppData/Local/Programs/Git/mingw64/share/git/completion/git-prompt.sh
    

    fi

    问题就解决了:)

    【讨论】:

      猜你喜欢
      • 2013-03-01
      • 2013-10-12
      • 2012-10-03
      • 2021-02-10
      • 1970-01-01
      相关资源
      最近更新 更多