侧边栏壁纸
博主头像
云BLOG 博主等级

行动起来,活在当下

  • 累计撰写 318 篇文章
  • 累计创建 6 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录
WEB

github批量仓库克隆,git clone某个用户的所有仓库

Administrator
2024-09-19 / 0 评论 / 0 点赞 / 0 阅读 / 0 字

利用github的api工具,

首先拿到用户名为kevin的所有仓库的url:

curl "https://api.github.com/users/kevin/repos?per_page=100&&page=1" | grep -w clone_url >clone.txt

过滤一下:

grep -o 'https://[^"]*' clone.txt >new_clone.txt

在txt文件中每一行前面加一个字符串git clone --depth=1 并保存到新的txt文件:

sed 's/^/git clone --depth=1 /' new_clone.txt > last_clone.sh

执行所有指令:

bash last_clone.sh

原文链接:https://blog.csdn.net/x1131230123/article/details/134588062

0

评论区