Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I git pull from a remote?

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?

like image 408
Jo Sprague Avatar asked Oct 20 '25 13:10

Jo Sprague


1 Answers

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.

like image 94
NubSteel Avatar answered Oct 23 '25 07:10

NubSteel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!