Created
July 12, 2020 00:49
-
-
Save BhargavMantha/e58db6712eaa814b2a9f04c08498fb7f to your computer and use it in GitHub Desktop.
This is the sh file of linux to clone private repositories of the user
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
| #!/bin/bash | |
| #!!!This is for Internal use only use at your own risk | |
| #optional change working_dir | |
| # working_dir=${1-$(pwd)} | |
| # cd $working_dir | |
| GHUSER="<USERNAME>" | |
| GITHUB_API_PASSWORD="<Password>" | |
| repo_list=$(curl -S --user ${GHUSER}:${GITHUB_API_PASSWORD} \ | |
| https://api.github.com/user/repos?visibility=private | | |
| grep -e 'clone_url*' | cut -d \" -f 4) | |
| for repo in $repo_list; do | |
| echo "Repo found: $repo" | |
| git remote set-url $repo | |
| git clone $repo | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment