为什么我无法从远程进行git pull?

4

我正在尝试从WP Engine上的远程仓库执行git pull,但遇到了问题。

$ git pull production master
fatal: Couldn't find remote ref master
$ fatal: The remote end hung up unexpectedly

我运行了以下代码以获取更多信息:

$ git branch -a
  master
* wpengine
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

然后尝试;

$ git pull production origin/master
fatal: Couldn't find remote ref origin/master
$ fatal: The remote end hung up unexpectedly

并且;
$ git pull production remotes/origin/master
fatal: Couldn't find remote ref remotes/origin/master
$ fatal: The remote end hung up unexpectedly

我引用的远程分支是否有错误,还是需要解决WP Engine的问题?


4
尝试使用 git remote show 命令,并检查是否有可用的 "production" 远程地址。 如果有,请尝试使用 git remote show production 命令并检查 URL 是否正确。 - func0der
@func0der 生产远程存在,并且URL正确。 - Jo Sprague
@Cupcake git remote -v 列出了我所有远程仓库的完整 URL。列出的所有 URL 都是正确的。 - Jo Sprague
抱歉,我误解了。这个有帮助吗?https://dev59.com/cGkv5IYBdhLWcg3w3Uk0 - iberbeu
1
@JosiahSprague 你尝试过从“production”远程克隆存储库到一个新的工作副本吗? - func0der
显示剩余5条评论
2个回答

3

我有完全相同的问题,在WPEngine上的一个新仓库中。问题的原因是我以前从未推送到该仓库,因此没有东西可拉取。解决方案是首先:

git push production master

从那时起,我可以随心所欲地拉动。

0

除非其他途径已绕过Git存储库将站点内容部署到站点上,否则您将无法获取该内容。

您需要从其用户门户网站下载备份,并进行初始推送以创建您的repo,然后您就可以从中git pull。

WP Engine git guide


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接