Skip to content

Commit 1a378f0

Browse files
committed
Made fully formed examples
1 parent 5b95d99 commit 1a378f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Let's learn how to clone a repository. Create a file named `clone.js`,
8787
and add the following code:
8888

8989
``` javascript
90+
var Git = require("nodegit");
91+
9092
Git.Clone("https://github.com/nodegit/nodegit", "nodegit").then(function(repository) {
9193
// Work with the repository object here.
9294
});
@@ -100,6 +102,8 @@ Let's learn how to open a repository. Create a file named `open.js`,
100102
and add the following code:
101103

102104
``` javascript
105+
var Git = require("nodegit");
106+
103107
var getMostRecentCommit = function(repository) {
104108
return repository.getBranchCommit("master");
105109
};

0 commit comments

Comments
 (0)