Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用yeoman构建git回购协议中包含的模板?_Git_Npm_Yeoman - Fatal编程技术网

使用yeoman构建git回购协议中包含的模板?

使用yeoman构建git回购协议中包含的模板?,git,npm,yeoman,Git,Npm,Yeoman,是否有可能创建一个简单克隆指定git回购(和分支)并删除.git的yeoman生成器 还是我走错了路 基本上,我想实现的是从Windows或OSX中的命令窗口。。为了得到一些选择。。根据选择的选项,我想克隆一个git回购并签出一个特定的分支,然后删除.git以丢失git连接 有什么想法吗?这里有一个生成器,它使用Yeoman的api从远程获取GIT回购: “严格使用”; 无功发生器=需要('yeoman-generator'); module.exports=generators.Base.ex

是否有可能创建一个简单克隆指定git回购(和分支)并删除.git的yeoman生成器

还是我走错了路

基本上,我想实现的是从Windows或OSX中的命令窗口。。为了得到一些选择。。根据选择的选项,我想克隆一个git回购并签出一个特定的分支,然后删除.git以丢失git连接


有什么想法吗?

这里有一个生成器,它使用Yeoman的api从远程获取GIT回购:

“严格使用”;
无功发生器=需要('yeoman-generator');
module.exports=generators.Base.extend({
构造函数:函数(){
generators.Base.apply(这个,参数);
},
//(1)提示
提示:函数(){
var done=this.async();
这是提示([{
键入:“列表”,
名称:'回购',
消息:“选择回购”,
选择:[{
名称:'Yeoman发电机回购',
值:“生成器”
}, {
名称:'Yeoman Yo Repo',
价值观:“哟”
}]
}],功能(答案){
this.repo=answers.repo;
完成();
}.约束(这个);
},
//(2)写作
编写:函数(){
var done=this.async();
this.remote('yeoman',this.repo,(err,remote)=>{
remote.bulkDirectory('.',this.repo);
完成();
});  
}
});
(1)提示中
我们使用Yeoman的基本API提示用户输入。有关更多信息,请参阅

(2)编写
时,我们使用Yeoman的
remote()
API从Github获取存储库,这是有文档记录的。正如您在文档中看到的,可选的第三个参数可能是分支的名称