4

Many people claim to have solved this problem in the following examples

However after testing these solutions out I'm given an error that claims the remote.setCallbacks(...) function is undefined. A quick check at the Nodegit API documentation

confirms that the remote.setCallbacks(...) function is indeed undefined. I tried this example code found on the Nodegit page

But this code freezes at the remote.push(...) command. How have people managed to actually push code to a remote repository using Nodegit? Any help on the issue I've found thus far has been a disappointment!

Community
  • 1
  • 1
Ethan Davis
  • 1,209
  • 1
  • 14
  • 21

1 Answers1

2

Unfortunately I was shooting myself in the foot all day. The reason the example code found at

wasn't working was because the remote github repository wasn't created before running the code. I'm guessing execution froze at the remote.push(...) command because the push prompt would make a request for the repository and not get a valid response, at which point it would make another request but still not get a valid response. Over and over again this would continue. The nodegit promise chain needs to establish a connection with the remote repository before it can finish. Unfortunately the Nodegit API documentation lacks explanation for many offered functions. Oh well, the important thing is a solution was reached!

Ethan Davis
  • 1,209
  • 1
  • 14
  • 21
  • I'm having the same problem as you. Are you saying the `examples/push.js` file in the NodeGit repo is incorrect? – ala8727 Mar 18 '16 at 16:19
  • It seems to be a half-truth for how to push to a remote git repo. `examples/push.js` seems to work for all pushes after the initial push which I carried out via the command line. `examples/push.js` seems to have trouble carrying out the `-u` option in a `git push -u origin master` call – Ethan Davis Mar 18 '16 at 16:29