This file contains 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 | |
# Clone all github.com repositories for a specified user. | |
if [ $# -eq 0 ] | |
then | |
echo "Usage: $0 <user_name> " | |
exit; | |
fi | |
USER=$1 | |
# clone all repositories for user specifed | |
for repo in `curl -s https://api.github.com/users/$USER/repos?per_page=1000 |grep git_url |awk '{print $2}'| sed 's/"\(.*\)",/\1/'`;do | |
git clone $repo; | |
done; |
Thanks a lot ! I have added a new functionality.
The added functionality allows for two different actions, depending on the state of the repository.
- Cloning non-existent repositories
- Pulling existing repositories
The code with the changes is here:
https://gist.github.com/ioritz1993/be12fd85fb3fd7a502d01597e8a9bd62
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
its needs to replace
git_url
toclone_url