Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clone all github repo #34

Open
myml opened this issue Jan 6, 2022 · 0 comments
Open

clone all github repo #34

myml opened this issue Jan 6, 2022 · 0 comments
Labels

Comments

@myml
Copy link
Owner

myml commented Jan 6, 2022

#!/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/{}
@myml myml added the system label Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant