【问题标题】:git-upload-pack not found when deploying [duplicate]部署时找不到 git-upload-pack [重复]
【发布时间】:2019-01-15 20:27:12
【问题描述】:

当我尝试将我的 React 应用程序部署到 github 页面时,我运行了 npm run deploy。它设法构建但在部署时出现以下错误:

git-upload-pack '.': git-upload-pack: command not found
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

我的git remote -v 回复:

origin  https://github.com/helplah/shopping-cart.git (fetch)
origin  https://github.com/helplah/shopping-cart.git (push)

【问题讨论】:

    标签: git github-pages


    【解决方案1】:

    我通过查看此处的其他答案设法解决了这个问题。首先,您输入which git-upload-pack 以查看 git 是否可以访问它。

    如果没有,在 Windows 7 上,您必须转到控制面板 -> 系统 -> 高级系统设置 -> 环境变量 -> 编辑路径。在那里添加 git-upload-pack 的路径。

    git-upload-pack 通常在C:\Program Files\Git\mingw64\binC:\Program Files\Git\mingw64\libexec\git-core。您可以在\Git\mingw64 中找到它。

    我添加了两个路径,重新启动计算机后它对我有用。

    【讨论】:

    • 谢谢,我尝试为很多博客找到解决方案,但这对我有帮助。
    • 最佳答案.. 我看了至少 10 个博客,但没有一个有用。
    猜你喜欢
    • 2013-02-25
    • 2012-06-23
    • 2012-05-07
    • 2010-09-18
    • 2011-08-27
    • 2012-03-16
    • 2012-07-30
    • 2020-09-15
    相关资源
    最近更新 更多