指定要clone的目录,而不是整个项目clone
import clone from 'git-clone-sparse';
clone('you git registry url', {
outputDir: path.resolve('.'), // 默认为'.'
targetDir: 'packages/project-a', // 默认为''
renameTargetDir: '', // 默认不修改目录名
// withDotGit: true, // 默认为false,即不附带.git目录
branch: 'v1.0.0', // 默认为master
});