var nodegit = require('nodegit');
var Clone   = nodegit.Clone;

var opts = {
	ignoreCertErrors: 1,
	certificateCheck: function() {
		return 1;
	},
	remoteCallbacks: {
		credentials: function(url, username, allowed_types, payload) {
			return git.Cred.sshKeyNew(username, 'PATH_TO_SSH_FOLDER/id_dsa.pub', 'PATH_TO_SSH_FOLDER/id_dsa', '')
		}
	}
};

Clone.clone('[email protected]_TO_REPO_GIT.git', 'LOCAL_TARGET_PATH', opts)
.then(
	function(repo) {
        console.log('ok');
	},
	function(err) {
        console.log('error');
	}
)
.catch(function(err) {
	clog('error', err);
});