4

I'm trying to do a git pull from a remote repo on WP Engine, and running into a problem.

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

I ran the following for more info;

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

And then tried;

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

And also;

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

Am I referencing the remote branch that I want to pull incorrectly, or is there a problem with WP Engine that I need to solve?

Jo Sprague
  • 16,523
  • 10
  • 42
  • 62
  • 4
    try `git remote show` and check if there is even a "production" remote that could be used. If there is one, try `git remote show production` and check if the URL is correct. – func0der Mar 03 '14 at 13:59
  • does ´git pull production´ work? – iberbeu Mar 03 '14 at 14:11
  • @JosiahSprague what does the output of `git remote -v` say? –  Mar 03 '14 at 16:41
  • @func0der The production remote exists, and the URL is correct. – Jo Sprague Mar 03 '14 at 18:04
  • @iberbeu `git pull production` asks for a branch `You asked to pull from the remote 'production', but did not specify a branch. Because this is not the default configured remote for your current branch, you must specify a branch on the command line.` – Jo Sprague Mar 03 '14 at 18:05
  • @Cupcake `git remote -v` lists the full URL of all of my remotes. All of the URLs listed are correct. – Jo Sprague Mar 03 '14 at 18:06
  • Ups, I missunderstood it. Does this help? http://stackoverflow.com/questions/10292480/when-deleting-remote-git-branch-error-unable-to-push-to-unqualified-destinatio – iberbeu Mar 03 '14 at 18:10
  • @JosiahSprague who are you hosting your remote repo with, GitHub or Bitbucket or someone else? Are you sure that the hosting company is up (like, they're not having a service outage or are under a DDoS)? Can you `ping` them? –  Mar 03 '14 at 18:27
  • @Cupcake WP Engine. They're up. They do a lot of non-standard things. It's looking like this issue may be on their end. I contacted their support, but opened this thread because I hadn't received a response there. – Jo Sprague Mar 03 '14 at 23:08
  • 1
    @JosiahSprague Have you tried to clone the repository in a new working copy from the "production" remote? – func0der Mar 04 '14 at 19:50

2 Answers2

3

I had the exact same problem, on a fresh repo on WPEngine. The problem turned out to be that I'd never pushed to the repo before, and so there was nothing to pull. The solution was to first:

git push production master

From then on I could pull as much as I'd like.

NubSteel
  • 75
  • 1
  • 8
0

You will not be able to git pull site content that has been deployed to the site by any other means than git, since they will have bypassed the git repository.

You need to download a backup from their user portal and do an initial push to create your repo, then you will be able to git pull from that.

WP Engine git guide

TinyStars
  • 31
  • 3