部署时找不到git-upload-pack

时间:2018-08-08 14:15:49

标签: git github-pages

当我尝试将我的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)

1 个答案:

答案 0 :(得分:4)

我设法通过查看此处的其他答案来解决它。首先,您输入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中找到它。

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