◐ Shell
reader mode source ↗
Skip to content
Merged
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
8 changes: 6 additions & 2 deletions examples/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var fileContent = "hello world";
var repoDir = "../../newRepo";

var repository;

var signature = nodegit.Signature.create("Foo bar",
"foo@bar.com", 123456789, 60);
Expand Down @@ -47,15 +48,18 @@ fse.remove(path.resolve(__dirname, repoDir))
.then(function() {
return nodegit.Remote.create(repository, "origin",
"git@github.com:nodegit/push-example.git")
.then(function(remote) {
remote.connect(nodegit.Enums.DIRECTION.PUSH);

remote.setCallbacks({
credentials: function(url, userName) {
return nodegit.Cred.sshKeyFromAgent(userName);
}
});

// Create the push object for this remote
return remote.push(
["refs/heads/master:refs/heads/master"],
Expand Down
Toggle all file notes Toggle all file annotations