Skip to content

clone repo from icode just for developer of baidu, support https and ssh.

Notifications You must be signed in to change notification settings

huangwenming/clone-icode-repo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clone-icode-repo NPM

clone repo from icode just for developer of baidu, support https and ssh.


Installation

Run npm install clone-icode-repo

Usage

precondition: the access to icode

	var clone = require('clone-icode-repo');
	var url = 'ssh://huangwenming@icode.baidu.com:8235/baidu/animation/mars';
	var dest = './temp';
	clone(url, dest, {type: 'ssh'}, function (err) {
        if (err) {
            console.log('error: ' + err);
        } else {
            console.log('the repo is pulled from icode successfully!');
        }
    });
  • the url parameter (string) is the address of code repository, its structure is: [protocol://] + [username@] + [origin/] + [reponame] + [#branch]

  • the reponame is required, the value of protocol defaults to https.

  • the dest parameter (string) is the file folder to store the pulled code.

  • the third parameter is an object, used to determine which protocol(ssh or https) to use.

  • the fourth parameter is callback for git clone.

About

clone repo from icode just for developer of baidu, support https and ssh.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages