GitHub clone all repositories

After you join an organization, you will need to clone all git repositories in your machine probably. 🙂

So first follow this post https://kenanhancer.com/2018/11/08/github-connect-with-your-ssh-public-key/ to create a ssh key in your machine and put in github then you can clone all repositories for any user.

if you have any authentication issue, then create an access token from github, copy and paste instead of {acceess-token} in the following code.

curl -u {access-token}:x-oauth-basic -s https://api.github.com/users/kenanhancer/repos?per_page=2 | grep ssh_url | awk -F '"' '{print $4}' | xargs -n 1 -P 4 git clone

In order to learn github API endpoint urls, use the following code.

curl https://api.github.com/

To learn more details about official GitHub REST API v3, use the following link.

https://developer.github.com/v3/

Leave a Reply

Your email address will not be published. Required fields are marked *