src/commands.js
function clone(options) {
    assert.ok(options.repository, 'repository is mandatory');

    var branchOrTag = options.branch || options.tag;
    var args = [
      'clone',
      options.repository,
      options.directory,
      branchOrTag ? ('-b' + branchOrTag) : null,
      options.origin ? ('-o' + options.origin) : null,
      options.recursive ? '--recursive' : null,
      options.bare ? '--bare' : null,
      options.depth ? '--depth' : null,
      options.depth ? '' + options.depth : null
    ];

    return git(args)
        .then(silent);
  }
function clone(options) {
    assert.ok(options.repository, 'repository is mandatory');

    var branchOrTag = options.branch || options.tag;
    var args = [
      'clone',
      options.repository,
      options.directory,
      branchOrTag ? ('-b' + branchOrTag) : null,
      options.origin ? ('-o' + options.origin) : null,
      options.recursive ? '--recursive' : null,
      options.bare ? '--bare' : null,
      options.depth ? '--depth' : null,
      options.depth ? '' + options.depth : null
    ];

    return git(args)
        .then(silent);
  }
function clone ( options ) { assert . ok ( options . repository , 'repository is mandatory' ) ; var branchOrTag = options . branch || options . tag ; var args = [ 'clone' , options . repository , options . directory , branchOrTag ? ( '-b' + branchOrTag ) : null , options . origin ? ( '-o' + options . origin ) : null , options . recursive ? '--recursive' : null , options . bare ? '--bare' : null , options . depth ? '--depth' : null , options . depth ? '' + options . depth : null ] ; return git ( args ) . then ( silent ) ; }
Clones a git repo

If both a branch and a tag are specified, the branch takes precedence

@example
var git = require('gitftw');

git.clone({
repository: 'git@github.com:jmendiara/node-lru-cache.git',
directory: './cache' //optional
});

@memberof git
@type {command}

@param {Object} options The options object. All its properties are {@link Resolvable}
@param {Resolvable|String} options.repository The git repository endpoint
@param {Resolvable|String} [options.directory] The directory where the repo will be cloned
By default, git will clone it a new one specifed by the repo name
@param {Resolvable|String} [options.branch] The remote repo branch to checkout after clone.
@param {Resolvable|String} [options.tag] The remote repo tag to checkout after clone.
@param {Resolvable|String} [options.origin] Instead of using the remote name origin to keep
track of the upstream repository, use this parameter value
@param {Resolvable|Boolean} [options.recursive] After the clone is created, initialize all
@param {Resolvable|Boolean} [options.bare] Make a bare Git repository.: neither remote-tracking
branches nor the related configuration variables are created.
@param {Resolvable|Number} [options.depth] Create a shallow clone with a history truncated to
the specified number of revisions.
@param {callback} [cb] The execution callback result
@returns {Promise} Promise Resolves with undefined
Clones a git repo