Last active
February 14, 2021 12:26
-
-
Save eana/b8792d0f6e484cfbfe73b94974514f58 to your computer and use it in GitHub Desktop.
Clone all repositories, including the private ones.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
GITHUB_TOKEN=$(grep token ~/.gitconfig | awk '{print $3}') | |
GITHUB_USER="eana" | |
REPOSITORIES=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/user/repos?per_page=100 | grep ssh_url | grep "${GITHUB_USER}" | cut -d ':' -f 2-3 | tr -d '",') | |
for repository in ${REPOSITORIES}; do | |
git clone "${repository}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment