myml / myml.github.io

myml的个人网站
https://myml.dev
3 stars 0 forks source link

clone all github repo #34

Open myml opened 2 years ago

myml commented 2 years ago
#!/bin/bash
name=$1

rm repos_*.json
while true;do
    let page++
    sleep 1
    wget "https://api.github.com/users/$name/repos?per_page=100&page=$page" -O repos_$page.json
    n=`cat repos_$page.json | jq '.[]|.full_name' | wc -l`
    echo $n
    if [ "x$n" != "x100" ]; then
            break
    fi
done
mkdir github.com
cat repos_*.json | jq '.[] | .full_name' | xargs -i git clone --depth 1 "https://github.com/{}.git" github.com/{}