Clone a remote git repository into a new local directory.
var Git = require('machinepack-git');
// Clone a remote git repository into a new local directory.
Git.clone({
destination: './put/the/new/local/repo/here',
remote: 'git://github.com/balderdashy/sails-docs.git',
branch: 'master',
}).exec({
// An unexpected error occurred.
error: function (err) {
},
// Insufficient permissions at destination path to clone repo repo.
forbidden: function () {
},
// Somthing other than an empty directory already exists at the destination path.
alreadyExists: function () {
},
// OK.
success: function () {
},
});
Path (relative or absolute) to the directory where the repo should be cloned. Will be created if necessary.
'./put/the/new/local/repo/here'
The URL of the git remote repository that will be cloned.
'git://github.com/balderdashy/sails-docs.git'
The remote branch to check out after pulling (if omitted, do not check out anything-- just use whatever the default is)
'master'
An unexpected error occurred.
Insufficient permissions at destination path to clone repo repo.
Somthing other than an empty directory already exists at the destination path.
OK.