Skip to content

Instantly share code, notes, and snippets.

@adityadeshpande
Created July 6, 2020 17:31
Show Gist options
  • Save adityadeshpande/f1632accf07f29057f66ecfc6a0ca13a to your computer and use it in GitHub Desktop.
Save adityadeshpande/f1632accf07f29057f66ecfc6a0ca13a to your computer and use it in GitHub Desktop.
var config = {
"options": {
"privateKey": "<pathToPrivateKey>/MyKeyFile",
"publicKey": "<pathToPublicKey>/MyKeyFile.pub",
"passphrase": "Y0ur.P@5$p#rAse.G0e5.H3rE!",
"twoWaySync": true,
"sshUrl": "<get_this_sshUrl_from_git>",
"signature_name": "Someone's Name",
"signature_email": "SomeoneWho@isMakingThisCommit.dev"
}
}
function InitGit(options) {
debug.info("Initializing Git...");
//Fetch values from config.
privateKey = options.privateKey;
publicKey = options.publicKey;
passphrase = options.passphrase;
twoWaySync = options.twoWaySync;
url = options.sshUrl;
signature_name = options.signature_name;
signature_email = options.signature_email;
credentialsCallback = {
credentials: function (url, userName) {
return nodegit.Cred.sshKeyNew(userName, publicKey, privateKey, passphrase);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment