[toc]
## 手册
>官网
>https://developer.github.com/v3/repos/>
## 获取仓库列表
```
https://api.github.com/users/fancierpj0/repos
```
如果是 **orgs**
```
https://api.github.com/orgs/组织名/repos
```
## 获取仓库的tag列表
```
https://api.github.com/repos/fancierpj0/antd-study-point/tags
```
如果是 **orgs**
```
https://api.github.com/repos/组织名/仓库名/tags
```
## 下载git仓库
```
import downLoadGit from 'download-git-repo';
```
```
export const downloadLocal = async (project,version) => {
let conf = await getAll();
//只需要用户名或则组织名以及仓库名,其余会自动补全
let api = `${conf.registry}/${project}`;
if(version){
api += `#${version}`;
}
return await download(api, DOWNLOAD + '/' + project);
};
```
```
export const download = async(src,dest) => {
return new Promise((resolve, reject) => {
downLoadGit(src,dest,(err)=>{
if(err){
reject(err);
}
resolve();
});
});
};
```