git - 为什么我不能从远程 git pull?

标签 git git-branch git-pull git-remote

我正在尝试从 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

我是在错误地引用我想要 pull 的远程分支,还是我需要解决的 WP Engine 问题?

最佳答案

我在 WPEngine 上的新 repo 上遇到了完全相同的问题。问题原来是我以前从来没有推过 repo 协议(protocol),所以没有什么可 pull 的。解决方案首先是:

git push production master

从那时起,我想 pull 多少就 pull 多少。

关于git - 为什么我不能从远程 git pull?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22148582/

相关文章:

git - 在接收后 Hook 中重用 GIT_WORK_TREE 来 rm 一些文件

git - 如何在 "git checkout"上更新工作目录?

Git:需要跨分支版本号

git - 如何以透明的方式从另一个 git 分支获取目录的副本?

git - 如何从远程跟踪分支获取 'git fetch' 和 'git merge'(如 'git pull')

git - git pull 和 git pull --rebase 的区别

git - 在推送之前我如何知道提交/更改列表

Git:在未跟踪的构建目录中使用 Makefile

git - 为什么 git log 在 git fetch 之后没有显示任何新内容?

git - lint-staged: 'git add' 命令的目的是什么