question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I need to do a git pull of a repo I cloned. Is there some example code that exists which could show me how to do this?

When I go directly to the repo on my machine, the only way to get it to download the latest is by git pull origin master.

Thanks for any help, Scott

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
AliMDcommented, May 20, 2015

Please make a simple push command

0reactions
johnhaley81commented, Nov 21, 2014
var nodegit = require('../');
var path = require('path');

nodegit.Repository.open(path.resolve(__dirname, '../.git')).then(function(repo) {
  return nodegit.Remote.load(repo, "origin");
}).then(function(remote) {
  remote.connect(0);
  return remote.download();
})
.done(function() {
  console.log("It worked!");
});

This shows how to fetch from a remote and works in the most recent version.

We’re currently planning on NodeGit to have as much libgit2 functionality in the library and then eventually extending it with a great API for end users that don’t quite need the low-level functionality.

Read more comments on GitHub >

github_iconTop Results From Across the Web

git-pull Documentation - Git
More precisely, git pull runs git fetch with the given parameters and then depending on configuration options or command line flags, will call...
Read more >
Git Pull: Tutorial with Detailed Examples - CloudBees
Well, git pull is a native command from Git. A pull request, on the other hand, is a feature from GitHub. A pull...
Read more >
Git Pull Explained - freeCodeCamp
git pull is a Git command used to update the local version of a repository from a remote. It is one of the...
Read more >
How To Use Git Pull | W3Docs Online Git Tutorial
The git pull command fetches and downloads content from the remote repository and integrates changes into the local repository. The git pull command...
Read more >
What's the difference between "git fetch" and "git pull"?
git fetch really only downloads new data from a remote repository - but it doesn't integrate any of this new data into your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found